Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Oct 09, 2017 at 09:42 AM by Morice1999 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Morice1999 · Oct 05, 2017 at 07:40 AM · movementvrcharactercontrollersoundsfootsteps

Footstep sounds system with a Vr touchpad movement system

Hello, i use the first person controller prefab from the Standard Unity Assets and modified the FirstpersonController Script by adding this code:

 if (GvrControllerInput.IsTouching)
             {
                 ddTouchpadPos = GvrControllerInput.TouchPos;
                 if (ddTouchpadPos.y < 0.5f - deadZone)
                 {
                     normalizedDDTouch = Vector3.ProjectOnPlane(cameraTransform.forward, Vector3.up) * 0.08f;
                 }
                 if (ddTouchpadPos.y > 0.5f + deadZone)
                 {
                     normalizedDDTouch = Vector3.ProjectOnPlane(cameraTransform.forward, Vector3.up) * -0.07f;
                 }
 
                 if (ddTouchpadPos.x < 0.5f - deadZone)
                 {
                     normalizedDDTouch = cameraTransform.right * -0.07f;
                 }
                 if (ddTouchpadPos.x > 0.5f + deadZone)
                 {
                     normalizedDDTouch = cameraTransform.right * 0.08f;
                 }
                 transform.localPosition += normalizedDDTouch;
           }

now i want to play sounds for every meter the character moves i dont get how the footstep system in this prefab works so it does not work for me can you please help me. Thank you anyways :) (Sry for my english)i have no animation for my character and no model

Footsteep System from the Prefab:

  private void ProgressStepCycle(float speed)
         {
             if (m_CharacterController.velocity.sqrMagnitude > 0 && (m_Input.x != 0 || m_Input.y != 0))
             {
                 m_StepCycle += (m_CharacterController.velocity.magnitude + (speed*(m_IsWalking ? 1f : m_RunstepLenghten)))*
                              Time.fixedDeltaTime;
             }
 
             if (!(m_StepCycle > m_NextStep))
             {
                 return;
             }
 
             m_NextStep = m_StepCycle + m_StepInterval;
 
             PlayFootStepAudio();
         }
 
 private void PlayFootStepAudio()
         {
             if (!m_CharacterController.isGrounded)
             {
                 return;
             }
             // pick & play a random footstep sound from the array,
             // excluding sound at index 0
             int n = Random.Range(1, m_FootstepSounds.Length);
             m_AudioSource.clip = m_FootstepSounds[n];
             m_AudioSource.PlayOneShot(m_AudioSource.clip);
             // move picked sound to index 0 so it's not picked next time
             m_FootstepSounds[n] = m_FootstepSounds[0];
             m_FootstepSounds[0] = m_AudioSource.clip;
         }

Edit: i read that there is no footstep sound in vr because thats annoying for users is that true?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
1
Best Answer

Answer by BlakeSchreurs · Oct 05, 2017 at 12:11 PM

Your Edit actually gets to the hart of the problem: There are usually no footstep sounds in VR. The heart of it is this: The players have their own feet, and they know when they move (or don't move) their feet. If they hear footstep sounds, without having moved their feet, they are either usually distracted by it (it breaks immersion since their feet and the sounds don't line up) OR they think someone's following them / sneaking around. You're probably better off without those footsteps.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Morice1999 · Oct 05, 2017 at 12:17 PM 0
Share

O$$anonymous$$ that sounds logical :)

Follow this Question

Answers Answers and Comments

139 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

is it possible to edit the Continuous Move provider (Action based) to add a jump feature? 1 Answer

how to not move on the x axis while not jumping 2 Answers

How can I guarantee a CharacterController never leaves the ground? 2 Answers

Charecter Controller like in Merry Bear game(Cube based game). 0 Answers

Stop animation when character controller hits walls 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges