- Home /
IsTrigger problem
Hello.
I have a problem with a box collider marked as a Trigger, I want my Player (CharacterController) pass trought it box givving the player ammo, it works perfect when pass the box through sides an below it, the problem is that the player collide at the top of it, I mean when the player comes from top can stand on it. I'm using this a script on the box with these lines at end:
function OnTriggerEnter (other : Collider) {
if (other.tag == "Player"){
taken = true;
if (isArea && taken) {
player.SendMessage("Restock", ammount, SendMessageOptions.DontRequireReceiver);
}
}
}
Any help is appreciated. Thanks.
Answer by Ozzyel-PT · Mar 26, 2014 at 11:25 PM
Ok it's fixed, I have in my player script a raycast to detect when the player should be grounded. Just added that box to Ignore Raycast Layer, was so simple.
Your answer
Follow this Question
Related Questions
Collision, change skybox in game 1 Answer
Script crashes Unity 1 Answer
Player 1 and Player 2 move together 1 Answer
Have script detect which collider 2 Answers