|
The locking part has and I do know the answer to that....Using a configurable joint and setting x,y,z motion and/or angularmotion to Locked or scripting to z=0 in the update. This works for the most part but I've found that when I drag my player object across a ground plane with a collider, that the Z-axis (for me) shifts ever so slighty, so a value set to 1000 will end up at 1003. This is enough to send my player off the boundaries of my game plane. Does anyone know how to constrain it to a value and if the value ends up slightly off it is automagically reset to 1000.
(comments are locked)
|
|
Use this code (untested js):
or (again, untested js):
The first code constantly sets z to 1000. The second code constantly sets z to the height of your ground, whatever that may be. Pick the one you need. Thanks that did the trick. I would add that I also found that checking off 'Configured in World Space' in the Configurable Joint inspector seemed to constrain things better...but not perfectly like the above code. Also, it solved this crazy flickering problem I was getting when I was at the boundaries of my game and attempting to move my ship beyond the boundaries. It stopped it and now is all smooth and silky. :-)
Aug 05 '10 at 05:19 PM
Vitruvius
Glad I could help you.
Aug 05 '10 at 06:44 PM
e.bonneville
(comments are locked)
|
|
you should do z=0 in LateUpdate().
(comments are locked)
|
