Game Development Community

World Limit Problem?

by Gagan · in Torque X 2D · 08/12/2009 (9:39 am) · 3 replies

hi

I have an image showing top view of a city having buildings surrounded by tracks.I need my player to move on these tracks only.
How can it be done??
Can an object has more than one world limit??

kindly suggest...thanks

#1
08/12/2009 (12:55 pm)
from your description, I'm assuming the buildings are surrounded by train tracks or sorts. There are a few ways you might be able to go about this, and I haven't actually tested any of them for myself.

In theory, you could code in several world limit coordinates to be swapped in and out using code. I don't know for a fact if world limits can be set during run time or not.

Or, you could block the character in place, with the exception of the tracks using collision objects and have the chr stop when he reaches one of the objects. Leave space between the collision object for the tracks.

That's all I got right now, Anyone else?
#2
08/12/2009 (1:23 pm)
If the tracks are always in between the building then make a Clamp collision with your player and the building.

If your buildings are not always near the tracks, then you could add blank scene objects and lay them out where you you don't want your player to go and then set clamp collisions on them with the player.
#3
08/12/2009 (4:19 pm)
i tested this onCollision() function..this proved out to be beneficial...
thanks