Hello, I would like a little help on how to achieve what I want, I have my BP players, as soon as he comes into contact with a zombie he can play a blood draw animation.
There will be 3 zombies in my level, how can I ensure that the player only performs the animation once and cannot start again on this zombie for example, but what remains, yes? I had thought about deactivating the zombie’s collision box after the animation but I wonder if there is something simpler?
That’s not a bad idea to be honest and would work. However, you may want to get a response from the zombie, indicating that it has already been drained, even after the fact. Many ways to achieve it. The most straightforward way would be for the to keep track of a boolean variable.
Before you play the anim, query the patient’s variable, if False
, play the anim - set the variable to True
.
Not sure the problem is but you can just create a bool variable as isDrainable = true
and check that in branch of function. That would be the simplest way of blocking the action.
After action is performed you can set bool isDrainable = false
so you wouldn’t effect your setup per instance.
Even with that you can give player feedback as “already drained” (sound vfx etc) and would be the proper way to store bool status in future for savegame if necessary.
Thank you very much for your help you guys are great
it works perfectly, small last problem the other customers can still come back after a player to drain the zombie only once, the variable is well replicated am I missing something? should I repnotify it?
Well depends on how you setup the multiplayer but here is some information around it Networking Overview For Unreal Engine | Unreal Engine 5.3 Documentation | Epic Developer Community
What you need to look for is Actor Replication in networking and Actor Replication. The basics are basically if you set IsReplicates. your variables will be copied to other clients.
You loot a box, box is looted for every player.
However if you are not replicating the Variable
Then each player runs its own instance and variables are not copied.
You Loot a Box, Bot is not looted for each player. They can loot their boxes also.
hello thank you for your answer after several tests it did not work I don’t know why I changed my method, I thank you for the answers provided because it worked for my other gameplay mechanics, have a good day and thank you
That’s not a bad idea to be honest and would work. However, you may want to get a response from the zombie, indicating that it has already been drained, even after the fact. Many ways to achieve it. The most straightforward way would be for the to keep track of a boolean variable.
Before you play the anim, query the patient’s variable, if False
, play the anim - set the variable to True
.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.