- Home /
Question by
TextToSpeach · Aug 26, 2020 at 07:31 PM ·
movementrigidbodyvector3vector
Move Forward Locally While Still having Collision
I am trying to make a tank game, where w and s move it forwards and back, while a and s turn it left and right. I am also planning to have walls and rigidbodys. I have tried but I can't find a solution. Please help.
Comment
Answer by GamerLordMat · Aug 27, 2020 at 06:26 AM
https://docs.unity3d.com/ScriptReference/Transform-forward.html
transform.forward gives you the local z vector. Or you could use Vector3 forward = gameObject.transform.TransformDirection(Vector3.forward);
Your answer
Follow this Question
Related Questions
Rigidody.velocity = Direction * speed; How to get direction? 1 Answer
Can't move player with rigidbody.velocity 1 Answer
Constrain character to series of intersecting paths? 1 Answer
Change player movement 0 Answers
Npc Movement 0 Answers