I am trying to give my enemy skeleton an aoe attack. When he starts to swing his axe I spawn an actor and when the attack is finished I destroy the actor.
The actor that I spawn is the half transparent black box in the first image. In the second image is all the code for that actor. All the code is ment to do is to print "INSIDE’’ if the player is inside the Mesh Component and “OUTSIDE” if the player is outside the volume.
My problem:
When the actor is initially spawned (with the player standing inside) the print says “OUTSIDE” until the player moves, then it says “INSIDE”. When the actor is initially spawned I want the print to be “INSIDE” if the player is inside.
And here is my AOE function inside projectile
Pay attention to the node inside red square, this the way to turn on collision with pawns if it’s needed, In my case projectile might be optionally with AOE
The collision is working fine for me. When I stand inside the static mesh component it prints “INSIDE” and when I step out it prints “OUTSIDE”. My problem is that if the static mesh component ( transparent black box) is spawned with the player already inside the print says “Outside” until the player starts moving.
I dont think your solution is going to work for me because I use a static mesh component while you use a sphere collision to check for collisions.
There is not much difference is it collision or static mesh, both components have the same ability to overlap
My way works as intended. You should use the begin overlap event, it helps in such cases when something appears.
I have actually tried this already. If the static mesh component (transparent black box) is spawned with the character already inside the begin overlap event is first triggered when the player steps out of the box and then in again.
In that case I would like the begin overlap event to first trigger when the actor is spawned and the player is inside. Hope you understand, thanks for your response!
Didn’t understand the problem with the begin overlap event.
I literally do the same, projectile flies with “hidden” collision, on some point this collision appears for one moment and starts overlapping with each pawn inside.
If you remove the bullet and enemy movement so that they are both standing still and then spawn your bullet inside an enemy does the begin overlap event trigger?
What do you mean? Do you mean that you find it strange that the begin overlap event is not triggered initially? Anyway, it seems like your solution does not work in my case but thank you for responding and taking an interest in this problem!
Thanks for the great idea! I tried some different variants of this.
1: On begin play I used the SetWorldLocation node with the Sweep option set to true, then moved the mesh component up some units. Did not work.
2: On begin play I then tried using the MoveComponentTo, this also did not work.
3: On event tick I moved the box up 0.01 units with the SetWorldLocation node with the Sweep option set to true. This made it so that the print always results in “OUTSIDE” even if the player is moving within the component bounds.
I think the problem might be with the player. When the transparent black box gets created the player actor needs to somehow send out a collision update. What I think might work is to move the player slightly right after the box is created.
This worked!
After the box gets created I move the player forward and the back on the X axis, this is to “awaken” the player’s collision. Hope this helps anyone facing the same issue in the future and thanks for all the great ideas for solutions from @Yaklakootmaa2
I think it is because there is no problem with the transparent black box registering collisions but that the player capsule only sends out collision updates when it changes its transform somehow, might work to scale or rotate the capsule as well.
I have the same issue. I save two actors that are overlapping. reload those two actors from the SaveGame object, I spawn them, and although their colliders are touching, they do not register any overlap. I tried to move them back and forth with 1 on the X-axis right after the spawn, but still doesn’t work. Any other suggestions?