0

Maybe it is because if been trying to fix it for a few hours now. But my character is not moving horizontaly.

First I was useing a cube as character to write it. When I replaced this cube with a player model it still moved up and down but not left and right anymore. Even after 2 hours of trying to figure it out I really couldnt stand it anymore and decided to post it on here.

Due to the long code I decided to paste it in pastebin.

http://pastebin.com/iAsN51rW

thanks in advance

2
  • Did you by accident set a fixed x or y position on the object?
    – Skami
    Feb 11, 2013 at 14:36
  • @skami At first i thought so aswel :) i found the answer. when switching to my model the side it faced changed so it was just moveing into the depth and back makeing it look like it dident move ;) after switching it finaly worked.... Was about time i found it .. took me almost 2,5 hours Xd;(
    – MX D
    Feb 11, 2013 at 14:39

1 Answer 1

0

I found the solution to my problem. And just like I thought, When Switching to my player model I had to change the movement direction from

transform.Translate(speed* Time.deltaTime,0,0);

to

transform.Translate(0,0,speed* Time.deltaTime);

As my cube was looking At the camera , But my player was looking towards the sides

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.