#Thread
1 messages ยท Page 1 of 1 (latest)
Hmm, maybe add a log message to OnTriggerEnter to check the gameobject tag on the collider you are hitting.
Oh and also, I think you need to set 'IsTrigger' on your collider.
That actually is probably the issue.
on the player or the object?
Yeah that's the question haha. Normally, I would put the behaviour script on the player rather than the object, and set the collider on the object to a trigger, then check for the trigger on the player. But the way you have it set up, I guess the player collider would need to be the trigger?
I'm honestly not sure though
i did that for the object but it still isnt recognizing
alright its ok
i will fight with it for a bit longer, thank you for the help
Did you try it on the player?
yeah it didnt work
Now I'm curious ๐
ahah ok
if you are up to keep trial and erroring i am, but i dont want to keep u if u need to go
I hate unsolved problems
fair ok
so basically the way i originally had it worknig is
the player was not a trigger and
the object was a trigger
when i had it set to
ontriggerstay
it would only trigger if the player walked in but wouldnt run while the player is always in
so theoretically i could try that again but idk if the on trigger leave still wont work
I'm still wondering what you are getting trigger enter messages for. You have a rigidbody on your player right?
nope that doesnt work
ya i have a rigid body
oop i have a rigid body
the message runs as soon as i load in and only once
did you print the tag out? I'm guessing it's empty
Like Debug.Log($"Other collider tag: {coll.gameObject.tag}");
Do you have a rigidbody on the object as well?
no cuz they are supposed to be able to walk thru it
it didnt work btw
Note: Both GameObjects must contain a Collider component. At least one of them must have Collider.isTrigger enabled, and contain a Rigidbody.
If one of the GameObjects has Collider.isTrigger enabled or both GameObjects do not have a Rigidbody component, no physical collision happens. In both cases, Unity still calls OnTriggerEnter.
So you have one that has a rigidbody, and its a trigger
You should check on your player
Add an OnTriggerEnter handler to your player, and see if you get a call for the object when you collide
Funny. You can just add a debug message though, remove it afterward.
ok one sec
It will probably get logged constantly
Actually, I guess it depends what is in your scene
It should initially be called for the ground anyway
its not triggering at all
Hmm that's weird. You have a collider and rigidbody for your ground right?
ya
It should at least collide with that...
i have no idea
i think im going to just set up office hours with my professor to figure it out ig
i will get an extension on the project for now
thank you for your help and if i figure it out, i will say smthn here so u know the answer lmfao
Lol thanks ๐