- Home /
Question by
CDAXRC · Jul 05, 2018 at 09:09 AM ·
collider2dsizeistrigger
Two colliders in one Game Object, one is trigger. How to change size of both?
I have 2 colliders attached to one object and I'm using this code for size change. void Start() { m_Collider = GetComponent(); }
void Update()
{
if (Rotation.negative)
{
m_Collider.size = new Vector2(1F, 0.9F);
}
How can I change both when one is trigger?
Comment
Answer by Papouc · Jul 05, 2018 at 10:38 AM
Hello just dont change size of coliders. I think that much easier way its to change size of the gameobject (if it is empty there is no problem doing it) Use : transform.localScale = new Vector3(x value, y value, z value);
Your answer
