Using normal Java in Unity
GameObject.Find("Body").collider.center = Vector3(0,0,0);
How do I do it in Java with #pragma strict?
Answer by Lttldude
Apr 25, 2012 at 09:57 PM
This should work:
GameObject.Find("Body").collider.bounds.center = Vector3(0,0,0);
Tell me if you still have trouble. Good luck.
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 navigate the site 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
4 People are following this question.
Move sprite depending on its collider position
How to get center of collider in hierarchy
how to change sphere/capsule collider, it sizes and the center
FPS collider center offsets camera pivot?