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?
I am not entirely sure if I understand your question. Do you want to constrain (player) movement along the surface of a mesh?
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
Answer by Jesse Anders
Dec 16, 2010 at 01:32 PM
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.)
i've also found that iTween seems to do a good job at this
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users post good questions and use the site effectively we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
No one has followed this question yet.
transform.active question - Model Mesh Scripting
How to select objects sharing the same material
Parented Empty GameObjects sticking to other objects problem
Basic projectile trajectory with transform
Check if end of object reached.