How can I get collision events when I spawn an actor?
Hello, I'm having an issue figuring out how to generate overlap events when I spawn actors on other actors.
In my game, I'm spawning spells in the world. I keep a running list of the objects within the collision area of spells by adding them when I receive a NotifyActorBeginOverlap() event and remove them I receive a NotifiyActorEndOverlap() event. For the most part, this has worked pretty well and given me what I want.
My problem is that I have a category of spells that I'm placing as an area directly beneath the player's feet. Whenever anyone touches the spell's area, I need to know. The problem is that I have no idea who's in the collision area when the spell is spawned. If the player (or a creature) leaves the area and comes back in, I'll receive a begin overlap event as normal, but I need to know without having to leave the collision area and come back in. Also, as one would expect, setting the collision to block instead of overlap gives a notification, but stops the player from moving at all, which is certainly not desirable (players and creatures should be able to run over it).
For reference, I am using UE 4.9 and I am looking for an answer in C++, as I do not use Blueprints. Thank you for your time.
asked Jan 19 '17 at 03:43 AM in C++ Programming
I reckon you are using a primitive component to do the overlap notifications, in which case I believe these are what you are looking for:
The actor.h class also has an overlapping components function, but I am not sure whether it works the same as the primitive component class functions.
answered Jan 19 '17 at 07:06 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here