0
votes

I have a beginner-like question. I currently have a gameobject in my scene that scales up and down via animation. It has a Circle Collider 2D on it.

I've seen some tutorials before regarding the performance optimizations of rigidbodies and colliders. I learned that if the gameobject should move in the game, it should have a rigidbody component. Otherwise, a collider component itself is fine for triggers.

Since my game object is kind of moving (because of the endless scale up/down animation), would it be best to put a rigidbody component on it?

I do like to mention that I'm not using any physics movement such as AddForce or anything like that. Hope someone can clear this up.

1

1 Answers

0
votes

A gameobject should have a rigidbody component for mainly two reasons, first one is if you are using physics, second one is if you want other colliders to detect a hit/entrance/exit by that gameobject. From what you described it does not seem like you would need a rigibody on your gameobject, especialy because the movement is only by scale and not by position. and also, just to clarify, putting a rigidbody component on a gameobject is not a must even if the gameobject is moving. there are different ways to move objects, and rigidbody usually helps in case that the movement should be very realistic and interact with other gameobjects it is colliding with.