0
\$\begingroup\$

I have my snowboard character which I am trying to fix the movement for. At the moment, The player is using transform.forward on the rigidbody to move forward. If my player turns around and faces up the hill, it keeps going no matter what. I need a way that my player goes in the direction that the gravity is pushing it, This will also mean my player can ride switch.

Also, My player is a capsule not a sphere so it doesnt roll around.

I have tried playing around with rigidbody.velocity but nothing seems to want to work.

if(Input.GetButton("Jump")){
transform.localPosition += transform.forward * Time.deltaTime * force; //force is the speed of the character
}

This is also Javascript ( yes I know i should use C# I'm learning it currently)

\$\endgroup\$
  • \$\begingroup\$ Why does your code snippet involve the "jump" button? \$\endgroup\$ – Alex F May 24 at 1:15
  • \$\begingroup\$ im using and xbox controller, when I hold A (Jump) it moves the player faster. \$\endgroup\$ – Knuckles209cp May 24 at 1:18
  • \$\begingroup\$ Have you looked at past Q&A about snowboard character control in Unity? \$\endgroup\$ – DMGregory May 24 at 1:22
  • \$\begingroup\$ Yes, It just says I need clever raycasting and clever rotation management thats all I can get out of it. I have no idea how to approach such coding in the first place. \$\endgroup\$ – Knuckles209cp May 24 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.