- Home /
Instantiated object not colliding when not have a rigidbody??
I'm trying to make a city building game. And when I click the mouse on Im instantiating a object on the planet (sphere) (with using raycast). if planet rotating, object rotating with planet too and object always looking at the planet(like on the image). the both are prefabs. Im instantiating just object. When I use OnCollisionEnter or OnCollisionTrigger on the object or the planet they are not working. And IsTrigger is false on both. But when I adding a rigidbody to object, OnCollisionEnter and OnCollisionTrigger is working but then my planet spining around. So how can i control the colliding detecting??
Answer by Llama_w_2Ls · Dec 12, 2020 at 01:17 PM
You must have a rigidbody and a collider to detect collisions with other objects. If you set the rigidbody to IsKinematic, the object will still detect collisions but it would seem like there isn't a rigidbody on it, allowing you to have a planet that stays still and doesn't spin around. @cankirici34
But when i do it that way the object not changing position when i turning planets.
wait sorry actually you are right but when i checked the kinematic the planet start turning with objects weight :/ @Llama_w_2Ls
Answer by cankirici34 · Dec 12, 2020 at 05:07 PM
Okay I just made collider IsTrigger true and OnCollisionEnter still works fine :D anyway thank you so much!