- Home /
Constraining 2D movement to polygon surface
Possible Duplicate:
Constraining 2D movement to polygon surface
Hi guys,
I'm looking to create a 2.5D platformer in which there are certain platforms that the player "sticks" to, and can walk on all sides of. Effectively I want to use the normals of these platforms to tell the player character which way "up" is, and to constrain his movement to these platforms so that he can move left or right all the way around them without falling off.
The problem is that I'm new to unity and I have absolutely no idea where to begin in making this work.
For testing purposes, I'm using a rigid body sphere to represent the player character. If anyone can offer advice to help me get such a sphere to "stick" to a polygon surface and roll around it's edges, that would be very much appreciated!
The following diagram demonstrates what I'm trying to achieve, where the black object is the platform polygon, the blue object is the player character, and the lighter blue objects are example positions the player character can roll around to, ignoring global gravity, etc.
Any help or advice at all is welcome, no matter how small! I really just have no idea where to begin, and this seems like the kind of thing that other people must have done before.
Thanks in advance,
Hadyn
For games like Soosiz, you'd notice that they only have certain objects - circles and "long blobs". Since they know the geometry of the walkabout terrain, it's just about finding the circumference. (no need to raycast)