- Home /
Duplicate Question
How can I contain a gameobject within 2d edge colliders?
I am trying draw a custom shape with edge colliders, I could draw it with a polygon collider as well, but I am unsure of how to 'contain' an object within the colliders. For example, if I draw a square with 4 edge colliders and put a circle collider inside, I want to be able to drag that circle with a mouse but only within the square. Keep in mind my custom shapes will be much more complicated than a square.
Answer by Fattie · May 03, 2014 at 06:06 AM
It sounds like what you're doing is incredibly wrong. Explain what you're actually doing (ie, "it's a tank game" or "I'm moving color squares around in a 2D puzzle" or "I'm using the gui" etc)
it's possible this could help .. http://answers.unity3d.com/questions/432009/resizing-a-gameobject-based-on-mouse-position.html
also http://answers.unity3d.com/questions/517200/how-do-i-permanently-resize-a-model-with-children.html
Follow this Question
Related Questions
A node in a childnode? 1 Answer
dragging out an object from mouse click? 1 Answer
Drag an object from the start of a path to end 1 Answer
physics.OverlapSphere colliders 1 Answer