x


Confining / Constraining an object transform trajectory to a mesh

Does Unity have any built-in support for confining/constraining the movement of Object A to being only on the surface of a non-planar mesh Object B?

more ▼

asked Dec 16, 2010 at 12:41 AM

ina gravatar image

ina
4.4k 1619 1255 1299

I am not entirely sure if I understand your question. Do you want to constrain (player) movement along the surface of a mesh?

Dec 16, 2010 at 12:46 AM Statement

Yes - say, the player is Object A, is there a way to constrain / confine movement to just the surface of an arbitrary mesh Object B

Dec 16, 2010 at 12:48 AM ina
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

No, there's no built-in support for this. (The behavior you describe is very specific and isn't the sort of thing Unity would be likely to support directly.)

However, the topic has been discussed quite a bit both here and on the forums, and if you search for e.g. 'mario galaxy' you should find some relevant threads. (In short, a fairly common solution is to cast a ray downwards relative to the object, and if there's an intersection, move the object to the intersection point and align the object with the surface normal at that point.)

more ▼

answered Dec 16, 2010 at 01:32 PM

Jesse Anders gravatar image

Jesse Anders
7.7k 11 25 61

i've also found that iTween seems to do a good job at this

Dec 23, 2010 at 04:15 AM ina
(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:

x2159
x2125
x477
x86
x23

asked: Dec 16, 2010 at 12:41 AM

Seen: 2190 times

Last Updated: Dec 16, 2010 at 12:49 AM