If I were to want to have bunch of 3D clouds moving along x axis in the distance only for aesthetic purposes what component should I assigned to them and what forces should drive those clouds for the best performance optimization? Currently I only have assigned rigidbody to the clouds without any colliders and the clouds are moved with .velocity function. I have also assigned a layer tag to those clouds and have turned of any coallision checking with objects that contain that layer tag in the physics settings(which I think is stupid on my part since Unity probably doesn’t even check objects without colliders for collision detection).
You shouldn’t use physics for that. Just apply a velocity to the visual meshes via transform.position. Something like this:
void Update ()
{
transform.position += myVelocityVector * Time.deltaTime;
}
@Edy So in that case I shouldn’t even have a rigidbody assigned to them?
Correct. Simply put the visual objects in the scene, then move them via transform.position. They shouldn’t even have colliders, as they don’t interact with the physics world.
Ok, that makes much more sense however despite managing the collisions in the physics inspector I haven’t actually assigned any colliders to the clouds which is an oxymoron move by me, I guess for some reason I thought that Unity checks collisions for all objects with or without colliders attached to them which really starts me to question my intelligence. But, one thing perplexes me, in this
video the instructor says that if we move a static object(an object without a rigidbody) Unity has to check and recalculate position for each other static body in the scene which is computationally heavy. So wouldn’t in that case the clouds that are moved via transform without a Rigidbody cause this unless of course the object are only static by a definition when having a Static property checked in the upper right corner of the inspector panel and not by the definition that I have mentioned the first time?