I would like to know how can I do a selective “force field” ?
I would like a force field that blocks the red and blue team players but let go the green team players. The selection (which team is blocked and which team goes through) will change in-game.
There will be several of these force fields in the level, which must work independently.
What are your ideas to do that ? I prefer C++, but I can do it in BP if it’s easier.
Thx in advance.
No ideas ?
Have found that I can use APawn::MoveIgnoreActorAdd and MoveIgnoreActorSub to add and remove force field in the ignore list of each players, and that for all forces fields.
I don’t like this solution, lot of work and network traffic just to manage that. And the palyer is block during 0.5 seconde before going through.
I need your help.
Not sure if there is a pre-built method for this problem. However it should be relatively simple at a basic level to implement. I’m assuming in code, you have some kind of container or way to distinguish between the different teams.
Therefore, you can set a ‘force field’ at a set position and then a radius from that point. You can then use FVector::Dist(ActorInTeamLocation, ForceFieldLocation) and if it is greater than the radius they will be leaving the force field and you will then need a method to put them back within the force field when the collision with the edge happens.
Although I have no idea about C++ I have done this in blueprints using custom collision channels.
I assigned each of the “teams” their own channel based off the default pawn channel. Then on run time I just set the force fields team as well, which blocks all other teams except the team it is assigned to.
Let me know if you need me to go into further.
If was BluePrints I would set TAGs for in the defaults for each character BP red tag for red team, blue for blue etc. then use the “actor has tag” node to allow the character to pass or block.
Have you figured this out yet? If not please reply and I’ll look into it…