Ben_93 Posted July 26, 2022 Share Posted July 26, 2022 Hi all, I really want to achieve being able to make a footstep sound effect as the first person controller moves (I am just using the generic first person controller node included in the blank template). Is there an easy way to achieve this? I have no programming knowledge at all, so fingers crossed its not too hard to implement! Many thanks, Ben Link to comment
silent Posted July 26, 2022 Share Posted July 26, 2022 Hi Ben, Are you using latest 2.15.1 SDK currently? How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
tarragrum Posted July 26, 2022 Share Posted July 26, 2022 Hi Ben, Need add SoundSource for left and right footsteps: Spoiler Update FirstPersonController.cs from attached file. There are main changes in 792-814 lines. In edtor set new fields in first_person_controller property Spoiler FirstPersonController.cs 3 Link to comment
Ben_93 Posted July 26, 2022 Author Share Posted July 26, 2022 Hi, Thank-you for getting back to me. I have tried the above suggestion but am having a little difficulty - if I try to import the attached code, there are some build errors and it doesnt work. Also if I copy and paste the lines from 792-814 from the attached code to the code in my first person controller, there is still an error building. Am I doing something wrong? Many thanks, Ben Link to comment
tarragrum Posted July 27, 2022 Share Posted July 27, 2022 Hi, Can you show me build errors? When you import attached file need delete FirstPersonController that is already in the project, but you need copy 24 line with guid Link to comment
Ben_93 Posted July 27, 2022 Author Share Posted July 27, 2022 Okay, so deleting the previous FirstPersonController that was already in the project and importing the attached on worked fine. No build errors. There is no need to copy those 24 lines of code right? If just using the attached controller? I have set footstep samples for both left and right feet, when trying in runtime it seems to play the samples on loop regardless of if the controller is moving or not - so still not working quite right. The sound samples are 9 seconds, so I need to loop - I have attached some screenshots, many thanks again for your assistance and my apologies as I am an artist with no programming knowledge :D Many thanks, Ben Link to comment
tarragrum Posted July 27, 2022 Share Posted July 27, 2022 Hi, Uncheck Loop flag and check "Restart On Enable". This will start the footstep sound from the beginning each time. You may need to shorten the footstep sample 1 Link to comment
Ben_93 Posted July 27, 2022 Author Share Posted July 27, 2022 Yes, that did it - trimmed the sample down to just one 'footstep' and checked 'restart on enable' and am happy enough for the result for now Thank you very much for your assistance - I appreciate it! Many thanks, Ben 2 Link to comment
Recommended Posts