I want to create a trigger on a rotating object which stays stationary to detect incoming objects from a certain spot. But when I try to add a collider(isTrigger is set) it rotates with the object. How should I do that?
You could duplicate your existing object and change some of the components so that it doesn’t move and doesn’t appear yet keeps the collider.
Try duplicating the object, disabling the mesh renderer component, marking the object as static and finally remove the collider from the original object.
This would leave a collider in the original place and allow you to rotate the original object freely without changing the position of the collider.
You can use an offset script.
Transform player;
vector3 offset;
void Start () {
offset = player.position - tranform.position;
}
void FixedUpdate () {
transform.position = offset ;
}