x


making perpetual movement

I am making a simple game involving a ball going down a half pipe. I want the ball to have perpetual movement so that it goes up and down without ever stopping. I have used the Constant Force component, and put it to -10 on the x axis (world). But I need the force to change to +10 once it's done going up the pipe. What would be the best way to achieve this?

more ▼

asked Feb 26 '10 at 08:58 PM

user-1415 (google) gravatar image

user-1415 (google)
1 1 1 1

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

1 answer: sort voted first

You could put a trigger collider at the point where the velocity has to change and have it call a function on the ball which changes its force.

function OnTriggerEnter (ball : Collider) {
    ball.gameObject.SendMessage("SwitchForce");
}
more ▼

answered Feb 26 '10 at 09:10 PM

Jason_DB gravatar image

Jason_DB
1.9k 4 14 36

(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:

x1999
x1869
x1788
x1367
x244

asked: Feb 26 '10 at 08:58 PM

Seen: 1274 times

Last Updated: Mar 09 '10 at 09:47 PM