I’m not using the CharacterController or Unity’s physics engine for my project - it’s a Starfox-type forced scrolling shooter. I’m not using Rigidbodies or anything; I’m just trying to get a Capsule Collider attached to my fighter to register an impact against the scenery, which uses Mesh Colliders. For starters, I don’t even know if the Mesh Colliders are even lined up properly: I’ve had previous tests where they had this wondrous habit of not being the right size, or in the same position as the actual model. Here, I’m not seeing anything but the default blue highlight lines, and it’s got me worried.
The Capsule Collider has “isTrigger” set, and I have an OnTriggerEnter function in a script attached to the fighter. It never fires off. Anyone have any idea what’s going wrong here?
Okay, I need a little more help. I’ve got collisions registering, but they’re not just triggering the function: the ship is actually getting knocked around slightly, and I don’t want that. More accurately, it’s what I want, but I want to handle it in my own way.
I’ve tried setting the fighter’s Rigidbody to isKinematic, but that disables collision detection, leaving me back at square one.
The problem with using non-trigger colliders is that they affect the physics of my fighter - I want to handle the collision reactions in my own way, since all movement is being handled with Transforms.
And I’ve discovered what’s going wrong when I use trigger colliders: my fighter is constructed of multiple objects, using a three-part “complex collider” (with capsule colliders for the main body and wings). It appears that if I use complex trigger colliders in this fashion, the parent object’s script never receives the trigger messages.
Any ideas how to use triggers in a complex collider?