Trigger and collisions..

Hello!

im using the function

function OnTriggerEnter( hit : Collider )

and im experiencing some problems. The turret that has this script shoots fireballs. The fireballs do not collide with my walls which are box colliders. How can I make these collisions possible…

At first i had a function OnControllerColliderHit(hit : ControllerColliderHit) function but my character wouldnt get hit if he stood still so i had to change to function OnTriggerEnter( hit : Collider ). And thats when i realized that the bulelts which are triggers are passing right through my walls…

Is there any easy way to fix this?

thnx

Create an child object where yo disable the mesh renderer.
Put an boxcollider to the child object!
Click on use as trigger.
I use both collision box and trigger box on my tiles in my game.

Unity is tricky to master but so much fun :smile:

Well, It still isnt working. The bullets are shooting right through box colliders marked as triggers. :S

Your bullets must have an rigidbody also!
Do they have that?
One of the objects that collide must have an rigid body to detect collision or trigger entry.
The smartest thing would be to have that on the bullet object.
I did like this on my bullets :wink:
But if i dont destroy them on impact so does it look crazy :smile:
As they bounce around on the screen :roll:
Iam an unity newbie my self :smile:
You could use OnTriggerStay instead of OnTriggerEnter( hit : Collider ).
And have you checked the size of the trigger collision box?
And checked so that its in use and not disabled?