Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
1
Question by raul corrales · Feb 11, 2012 at 05:26 PM · fpsspeedfps controller

How to know the speed of my FPS controller?

Hi all people, i need help with my FPS game, the question is this:

How to know the speed in real time of my FPS controller?

In need this help to make the sound steps for my player.

Greetings all people and sorry for my bad english.

I show my game in some screenshots i will hope you like the game. Nextly in Kongregate: alt text

alt text

alt text

Comment
Add comment · Show 1
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 MD_Reptile · Feb 11, 2012 at 05:38 PM 0
Share

Cool lookin game man - but I dont totally understand the question? are you using the default FPS controller that comes with unity? Did you make your own? I think the one in unity has a setting to change the speed, so I guess you could say that your speed is that setting if thats what your meaning...try and rephrase the question a little

1 Reply

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by aldonaletto · Feb 11, 2012 at 05:39 PM

If you are using the CharacterController, it's better to measure the velocity in Update:

private var lastPos: Vector3; private var curVel: float; // shows the current velocity

function Start(){ lastPos = transform.position; }

function Update(){ var displacement = transform.position - lastPos; lastPos = transform.position; curVel = displacement.magnitude / Time.deltaTime; } If you want a more smooth velocity indicator, use Lerp to filter it - replace the curVel assignment with this line:

   curVel = Mathf.Lerp(curVel, displacement.magnitude/Time.deltaTime, 10f*Time.deltaTime);

The value 10f controls the smoothness: low values make the velocity too slow and smooth, and higher values reduce the smoothness and make curVel follow the actual velocity more quickly.

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 raul corrales · Feb 11, 2012 at 05:53 PM 0
Share

very thanks my friend!!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

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

Related Questions

How do I make the default fps character controller not stick to the mesh it is standing on? 0 Answers

Sprint and Crouch problem! 1 Answer

Switching to the player camera 1 Answer

Why won't my rigidbody fps controller move? 1 Answer

How can I get a responsive rigidbody FPS controller without acceleration that reacts to forces? 2 Answers


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