- Home /
Question by
AnisaLl · Dec 08, 2015 at 12:02 PM ·
movement3dthirdpersoncontroller
Block movement of an object in a certain direction which is not x, y or z axis
Hello,
I have three objects each positioned in one side of a triangular prism. I want these objects to be able to move in 2D only which means right, left and up. For each of these objects I am using Unity's script from Sample Assets of ThirdPersonCharacter for movement. For one of the objects I am able to lock the z-axis so I don't let it move forwards and backwards. However, for the other two locking this axis does not work since their right and left movement is not through x-axis only but in the x-z plane. I want to lock the movement in a direction 60 degrees from the z-axis. How can this be possible?
Thank you for your help!!
Comment