x


Moving character to a specific point ?

I'm making a turn based game and everything has been going fine until i got stuck on this problem. I need the player (With a rigidbody) to move to a selected cell. I have it working with transform.position but the player just snaps to the cell, whit i want him to slowly move to it. I tried rigidbody.MovePosition but it doesn't seen to work properly. Is it wrong to use rigidbody.MovePosition are there any other way's ???

more ▼

asked May 17 '12 at 03:26 AM

vipvex gravatar image

vipvex
29 16 27 30

Are you moving the player over time or are you instantly moving the player to a position instantly.

May 17 '12 at 04:09 AM kolban

I think he means over time " i want him to slowly move to it"

May 17 '12 at 04:13 AM Alismuffin
May 17 '12 at 04:17 AM Alismuffin

Lerp is nice and all, but I find myself using MoveTowards more often as it gives a consistent speed and moves exactly to the designated position meaning an if (pos == tartegpos) statement is valid, which is very convenient. Lerp will give nice ease in and out, but that's not always a desirable effect.

May 17 '12 at 10:09 AM asafsitner

Well, if your lerp is going from point a to point b then Lerp will give you consistent speed. It'll only give you the 'ease-in-ease-out' thing if you are using lerp to snap to a moving object.

May 17 '12 at 10:16 AM syclamoth
(comments are locked)
10|3000 characters needed characters left

0 answers: sort newest
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3328
x1044
x206
x132
x49

asked: May 17 '12 at 03:26 AM

Seen: 631 times

Last Updated: May 17 '12 at 10:16 AM