How do I make two players entering one trigger box at the same time, trigger an animation.
having two things execute at the same time is impossible, not only for the computer but also for the players. i can see your intent in your script you posted but i imagine the way that actually worked is that if either the penguin or human overlapped then the door opened. it worked this was because a sequence does thing one then immediately does thing two.
instead you want to have the overlaps occur within a given window of time (duration is situation dependent). so basically you want on one player overlapping nothing to happen but if within one second the other player overlaps as well then do a thing. i did this using a delay.
in example one when one player overlapped i set a variable to true then when the other player overlapped i set a different variable. if both variables were set to true then the animation gets fired, or in this case print string it worked. if the second player didnt overlap in time though the variables would be reset.
in the second example i did basically the same but instead of variables i used a multigate. the first time a multigate is triggered it does pin 0 then the next time its triggered it does pin 1etc etc.
and as a little bonus the third example is a good one to use when the situation isnt time dependent. it just gets the overlapping actors whenever there is a new overlap. if both actors you want are overlapping then the branch reads true and prints the string ( aka plays your anim).
for non time dependent situations all three can actually be used just remove the scripting that resets the variables or gate.
guess we were thinking similar things. im just slower on the draw as they say.
So I know you’re probably gonna need screen shots haha BUT until then I can at least tell you what to do. So what you can do is use 2 boolean variables, once for each character and store the boolean variables in the level BP (or wherever you made the reference to the trigger volume). After the “on actor begin overlap”, cast to penguin, if TRUE set one of the boolean variables (i.e. penguin overlapped) to true, then after that have a branch node with an “AND” boolean (this will check 2 boolean variables and if both are true will allow execution to flow through). Connected to the AND node will be both booleans one for each character. If the penguin cast fails, cast to Human AI and if that is true set the other boolean variable (i.e. Human overlapped) to TRUE. Connect from that “Set” node (of the custom boolean variable) to the same branch node with the AND boolean check. This way, only when both are true will execution pass through the branch node to whatever you want after that.
Haha…I got you man, no worries!
I have been beeping EmilyBec on a few questions so I know a little bit about her game which is why I think the boolean thing will be fine. She has 2 characters follow each other so pretty sure she just wants to make sure both are in the vicinity to trigger the animation, which is why I just used a simple double cast so it won’t matter which character enters first as long as both characters eventually enter the box trigger.
hahaha thank you for saving me again, It works perfectly!
Thank you for the help
You will have to let me know when you finish this game so I can play/see the final result. Although if I keep all these blueprints I might have a copy of it myself haha Are you starting to get the hang of the engine yet? Also, I forgot the “AND” boolean, I would recommend hooking up the variables as their own separate “get” nodes instead of directly from the “set”. Even though it is working now, potentially you can run into problems down the road if the variables are being set/changed in multiple places. It is an easy fix to keep the code clean, just unhook the “Set” booleans and add a “get boolean” node as I show below.
Hahah I will! I will send you a link once it is done. I think I have to put you in the credits too! and thank you I will do this now. I am kind of getting used to the engine, I can make a basic trigger and I understand blueprints, other then that I am still struggling haha
Would you also happen to know how to do this one? How to make object grow - World Creation - Unreal Engine Forums