- Home /
How to move a sphere relative to its own axis?
Hello! I have been trying to move a sphere relative to its own axes and not the real x and y axes. For example, when it rotates, I want it to move what the camera sees as forward and not just increase its position on the x or y axis. I do not have any code that has worked at all. I am very new to this and would appreciate a thorough explanation! thanks
Answer by Umresh · Aug 03, 2017 at 09:35 AM
I'm not sure how you are moving your object. Try his
YourObjectTOMove.transform.Translate (Vector3.forward*speed, Space.Self);
Answer by Timo326 · Aug 03, 2017 at 09:41 AM
public float speed;
void Update()
{
transform.Translate (transform.forward * speed * Time.deltaTime);
}
Your answer
Follow this Question
Related Questions
I am trying to make a movement script for my main camera but it isnt working! 2 Answers
Enemy AI Movement one axis at a time (8 directional - 2.5d) towards player/target 2 Answers
How to get Horizontal axis value to 0 instantly after releasing the positive button!!!! 0 Answers
Newbie Question 2 Answers