- Home /
Moving Rigidbody 2D
Hello,
I'm trying to move a rigidbody around a grid using this code [inside void FixedUpdate()] :
AVoidGetInput(); //and get the next grid position to 'destination'
Vector2 go = Vector2.MoveTowards(transform.position, destination, Speed)
GetComponent<Rigidbody2D>().MovePosition(go);
It was working as i wanted : https://www.youtube.com/watch?v=eeRp9O64JEM
But the i decided i would use a camera smoothing : https://www.youtube.com/watch?v=OVfA294foHM
It started to 'lag', and I have no idea why that happened..
I'm using the code mentioned here : http://answers.unity3d.com/questions/29183/2d-camera-smooth-follow.html
(on the first answer by amaranth)
So, I'm lost in how I should move my character in this grid properly. Thanks in advance =)
Your answer
Follow this Question
Related Questions
move a child object to a specific xyz coordinates 2 Answers
assetbundles and server request load 0 Answers
Round a Vector3 to a grid position? 2 Answers
List or Grid View of lots of text data in Bitverse 1 Answer
Movement by increment jerkiness 1 Answer