x


Rigid body enemy

Hello, I am coding a rigid body based enemy but it moves by applying forces and I wanted to make it run in a fixed velocity, is that a way to do it? move it without apply forces and make it still collide just like character controller? (I dont wanna use character controller).

Thanks!

more ▼

asked Jun 10 '11 at 05:39 AM

Fubiou gravatar image

Fubiou
30 12 12 15

(comments are locked)
10|3000 characters needed characters left

1 answer: sort newest

To move at a constant velocity, add the force of desiredDirection * (topSpeed - velocity.magnitude).

If you want to accelerate to a top speed, clamp that multiplied value to an Acceleration value.

Also, look up various ForceModes to determine which one is right for you.

more ▼

answered Jun 10 '11 at 07:22 AM

Nemox gravatar image

Nemox
169 11 16 19

(comments are locked)
10|3000 characters needed characters left
Your answer
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:

x652
x316
x32
x32
x18

asked: Jun 10 '11 at 05:39 AM

Seen: 891 times

Last Updated: Jun 10 '11 at 07:22 AM