- Home /
Prefab structuring for compound colliders and animations.
I have a prefab for vehicle that moves with AI in the game with the following structure: - Empty GameObj Parent (component to move the car with AI) - model (the 3d model of car) - collider (this collider is used for collision avoidance in front of the car with other vehicles) - collider (this collider is around the whole vehicle to test for collisions with the player) The parent has a Rigidbody component and the AI moves the vehicle by modifying rigidbody.transform instead of directly changing the transform. I was doing this because the initially the parent had a collider attached to it and the collider was being recreated every frame if i directly changed the transform. But now the parent does not have any colliders, so if I attach a animator component to the parent that animates the transform of the parent will the colliders of the children be recreated. Also, if anyone has any recommendations on best practices to structure such prefabs with compound colliders and animators please feel free to share. Thanks.