Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
Sign in to follow this  
Sunix

Help To move Forward of the player direction

Question

Posted (edited)

hello

i need some help on this script , i just want to make my player move forward of his direction (it should be easy but ... i dont understand -_-)

the player is actually following world coordinate , up go up down go down ...top down view i just need to make the playe go forward when you press up and backward on press down , 

Please login or register to see this code.

If someone could help about how to do this , if you need more part of the script i can give 

Thanks for the help .

Regard 

Edited by Sunix
add details

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 1

No, in your first script. Change TempRigidbody.velocity = movementDir to TempRigidbody.velocity = transform.TransformDirection(movementDir);

  • Like 1

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)
Please login or register to see this quote.

Thank you for you reply , i'm so lost on this kit i bought 

 

Please login or register to see this code.

in this ? or may be if you want i can send you the project base or the compete script because if its not that other transform look to be for audio , or may be im wrong

Edited by Sunix

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

OMG its working , good , i tryed to search many example on the net (tryed some sort of script hack but no one worked), but most was return to nothink , and you saved me some days , i guess i would never find the solution , i was more trying to modify the direction or the movementDir. 

Thank you so much Please login or register to see this link. , i feel like so much noob but my problem is solve now 

And im happy to see GREAT and helpfull peopple as you on the forum .

Share this post


Link to post
Share on other sites
  • 0

It's no problem. Just remember, if you ever want to transform a vector into local space, whether it's a point in space, direction or rotation, refer to the transform methods and you will find them there

  • Like 1

Share this post


Link to post
Share on other sites
  • 0

yeah, thank you  i will try to remember , i have much again to learn on unity   :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×