How to make player character and an item activate trigger

So i have the player character, which is from the ball demo, the player character has an item that can be dropped when pressed q.

The goal is to allow the player character and the item to activate a trigger.

I can get the player character OR the item to activate the trigger but not both.

First i fiddled with physics and collision and couldn’t make that work, so i checked for this with blueprints.

One thing i tested was:

inside the trigger actor bp

on begin overlap> cast to player > set boolean 1 > cast to item > set boolean 1
on end overlap> cast to player > set boolean 0 > cast to item > set boolean 0

on both cast nodes i set the object reference pin to the on begin overlap & on end overlap´s other actor pin
Sadly that didn’t work either.

Any help would be greatly appreciated on this topic.

… can you post a quick screen image of your blueprint… I think the logic needs readjusting

I think I’d use a boolean OR condition here

Use “AND” Boolean. On BeginOverlap check if OtherActor is equal to PlayerCharacter AND is equal to Item then use a Branch. The True of the branch will never fire until both conditions are fulfilled.

Well i deleted the last set up since of course it didn’t work. I tried your way, and this is how i wanted it, to have both the actor and pawn connected into the actor pin.

Ego Studio
Iam not getting a response cus i’m missing something and i’m sure you’ll point that out to me :smiley:
I didn’t know the other actor pin means i MUST connect the player as well to that pin else nothing works.

here you go ANorthStar

You should connect GetPlayerCharacter or your Character Reference and the Item Reference to the Equal (Try not select asset directly). You should have the item reference somewhere though, like Traced Item or Equiped Item…

the Begin Overlap is called when one of both enters the area and other object will be the object that started overlapping. there is always only 1 object so you cant test if both are overlapping like that. you need to save that on is overlapping and when the other than overlaps you can trigger your button.

i used some random class to cast to, but you should cast to your Blueprints

sorry, I misread your original question… yes, if you need both of them to be in the trigger volume TOGETHER, an AND boolean is the right option… it looks right to me… run a Print String off the True branch and test it in PIE… are you getting a “Hello”?
Just check that your collision and overlap settings on your Pawn and Trigger Volume are correct :slight_smile:

if possible, I’d use the “Is Overlapping Actor” node instead of Begin/End Overlap

ANorthStar is right. Adding DoOnce and Reset when False would make it. But still, avoid Tick as much as possible for performance.

dark-killer > CastToStaticMeshActor only execute when CastToCharacter failed, so when CastToCharacter succeed, we don’t check for StaticMeshActor.

you dont need to check the other cast when one succeeds, since the object can never be a Character and a StaticMeshActor at the same time.

Oh yeah, you’re right. Smart approach.

ANorthStar and Ego Studio i did your approach

I am not sure though how to connect from the branch into the timeline so i have tried both true and false.

At most i got the player character to activate the button, but when i drop the bomb(item) the trigger is unresponsive.

Dark-Killer i did as u said aswell.

Again same as above i was unsure on how to connect the branch so i tried both ways. And ended up with the same result. The bomb(item) is not activating the trigger.

So i tried changing the collision settings, but no matter what i can’t seem to get the effect i want.
So ill post the current state of the bomb item´s collision setting.

Why are you executing your Timeline when the condition is False ?

In the clip iam using the cast nodes
When both are set to true, the trigger does not react to player, but reacts to the item actor, though it still thinks the item is on the trigger even if the item destroyed.

when both branches are set to false the trigger responds to the player when its on the trigger. It works as it should, but for the player only. And the trigger does not react at all to the item(bomb).

trying true on one and false on the other just renders the trigger in responsive so it only seems its working still not, if both are true or false.

As for using the equal method iam not getting any response from the trigger. No matter if i connect it from true or false to the timeline.

The absolute solution is using Tick like the graph above, use DoOnce and Reset on False. There’s no way it should not work.