#Thread

1 messages ยท Page 1 of 1 (latest)

alpine helm
#

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.

red dome
#

on the player or the object?

alpine helm
#

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

red dome
#

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

alpine helm
#

Did you try it on the player?

red dome
#

yeah it didnt work

alpine helm
#

Now I'm curious ๐Ÿ™‚

red dome
#

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

alpine helm
#

I hate unsolved problems

red dome
#

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

alpine helm
#

I'm still wondering what you are getting trigger enter messages for. You have a rigidbody on your player right?

red dome
#

oop i have a rigid body

#

the message runs as soon as i load in and only once

alpine helm
#

did you print the tag out? I'm guessing it's empty

red dome
#

wdym

#

sorry idk what print the tag means so im probably not doing it lol

alpine helm
#

Like Debug.Log($"Other collider tag: {coll.gameObject.tag}");

red dome
#

oh lemme see

#

ok its saying untagged

#

let me try adding a tag to the

#

object

alpine helm
#

Do you have a rigidbody on the object as well?

red dome
#

no cuz they are supposed to be able to walk thru it

red dome
#

it didnt work btw

alpine helm
#

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

red dome
#

my player script was given to me by my prof so im a lil nervous to touch it lol

#

uhh

alpine helm
#

Funny. You can just add a debug message though, remove it afterward.

red dome
#

ok one sec

alpine helm
#

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

red dome
#

its not triggering at all

alpine helm
#

Hmm that's weird. You have a collider and rigidbody for your ground right?

red dome
#

ya

alpine helm
#

It should at least collide with that...

red dome
#

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

alpine helm
#

Lol thanks ๐Ÿ™‚