Good day kind people,
Let me start with explaing my intentions:
It is my intention to create 1 cube that can be moved around a level by pressing the WASD keys, this gave me no problem and you could easely move the cube around the level.
This however was done by using the Transform.position, but i wanted a cube that had physics, so i changed the Cube to have a Cube collision and a Rigidbody,
Now in stead of using the Transform.position (which wouldn't give me my physics) i used the AddRelativeForce (which would add force to the physics object forward into the direction it is rotated to, correct me if im wrong please)
Done so using the following code:
float v = Input.GetAxis ("Vertical"); float h = Input.GetAxis ("Horizontal"); Vector3 relForce = new Vector3(h, 0, v); mybody.AddRelativeForce(relForce * 20);
Now here is my problem:
The AddRelativeFoce function isnt doing what i think it should be doing, the 2 things that i noticed:
1: It isnt acurate in checking the rotation and adding force to my object in that matter, for instance my cube has a rotation of 36 degree and its pushing my cube "forward" like it only has a rotation of 30 degree.
2: If we ignore my last matter and add some relative force to my Cube regardless of its rotation i noticed that if i were to release my key to go forward it slows down, now that ofcourse is supposed to happen but: instead of moving forward and slowing down, it moves forwards and slows down with a little offset to the left or right (yes it makes a little curve sideways).
If my explanations aren't clear enough or you would like some visual material to see, just drop a comment and ill create a video of my problem occuring.