- Home /
Scale object, collision not working
I using BoxCollider2d.The object consists of three parts: body, top and bottom. I scale the body, top and bottom moving relative to the body with a script: script transform.position = anchor.position;. It scaling, by pressing buttons up and down, collisiont is not working. Download archive
script transform.position = anchor.position;
![alt text][1]
[][2]
Try to put all 3 objects inside one parent object and scale only it, without scaling that 3 objects separately
when im lazy i just add a line of code to move the objects position by a very small amount (0.0001f) when im scaling it
GREAT NEWS!! i downloaded your file and took i look at it. I have changed some scripts and gameobjects and it works great. i will send the file to you as soon as im done.
Your project is done. I have provided everything for testing. If you want something more better, please send the details of what you want. If it works for you, please don't forget to click on the answer solved button beside my post.link text
Answer by rukawan44 · Mar 23, 2015 at 08:26 PM
Using unity translation method will not detect any collision. try using a rigidBody2D and then the addForce function to move objects and detect collisions while moving a gameobject.
Answer by Kaka95 · Mar 24, 2015 at 07:26 AM
traform.localScale = new Vector3(x,y,z); //It worked for me