Alright. I’m going to start with my question and then I’m going to explain what I’ve tried. I’m hoping y’all can help me. I am VERY new to Unreal Engine. I’ve got a Character with a Collision Sphere attached to it. The goal is to have something like the garlic effect in Vampire Survivors. Whenever an enemy character is within the Collision Sphere it’ll slowly have damage done to it.
Here’s what I’ve done. I’ve made sure that Generate Overlap events is turned on for both my Player Character and my “Bad Guy” character. (That seems to be the most prevailing issue in my google sleuthing). I’ve set this up on the Blueprint for my Player Character. SetLightRadius can be ignored. It sets the radius of the Collision Sphere based on a variable I have on the Character.
It’s never seeming to get any overlapping actors. Last night I was messing around with Get Overlapping Components. That at least seemed to recognize that there was overlapping. This never seems to do anything inside the For Each Loop.
…and here’s another of our “Bad Guy” Capsule Component
Any help you might be able to offer on this would be super helpful. My plan inside the loop is to try to cast each array element to each kind of actor where I want something to happen when it collides with the sphere and then have a function on the BP for that actor that knows what to do when it collides with the sphere.
Feel free to let me know if I worded anything badly. I more than likely did. This is only my second day messing around with Unreal Engine.
Doesn’t solve the overlap issue, but I’m probably going to use an interface for calling the method for handling overlap on each overlapping actor instead of trying to cast. Will reduce coupling by the Collision Sphere not needing to know what it might be colliding with.
Well for one the print string isn’t connected to the loop execution so nothing will happen. I do something similar for lava damage in my game, the best way id think to go about this would be using GAS and setting up an over time effect, or create a damage class that can be called and applied to each individual actor while checking if their still overlapped, you may be able to accomplish something like this using a custoo event or just continuing on with the overlap events depending on how exactly your wanting this to work
I thought you only put a filter class in Get Overlapping Actors if you want to filter it to a specific class. If you don’t put a filter class then won’t it get all overlapping actors?
Is it possible to pass an array of classes into the filter class?
Duh. Not sure how I missed that one. I’ll probably stick with trying to make this work because eventually damage won’t be the only mechanic. Like one mechanic will be to light a torch if it overlaps.
That’s why I’m going to do an interface and have a function to call when it’s overlapping. So each actor can handle what happens when it overlaps accordingly.
I think there might be a misunderstanding. You don’t need to put in different classes in there, only your actor class. That node returns the objects that overlap with the collisions of that actor. If you want to filter the collisions, you can just adjust the collision settings of your actor
Since we’ve established that the “Get Overlapping Actors” node returns the overlapping actors of a class, it would make sense that it would need a class to check if it has any overlapping actors.
Here’s the node’s documentation if you want to check it out:
I see what you’re saying. I could be wrong, but I thought I was doing that by setting Target on Get Overlapping Actors. When I established the Node I right clicked on the Blueprint and chose Get Overlapping Actors for SC Light Blundary.
I got confused when you said class because the filter class is the only input on the node that doesn’t have a value.
Are you referring to collision filtering? You can find collision settings in the details window of your actor. Check the documentation that I provided in my previous post for further guidance.
No. I’m talking about Get Overlapping Actors. I want all actors that overlap with SC Collision Boundary. Looking at the documentation you provided for Get Overlapping Actors if I provide SC Collision Boundary as the target (which I’ve done) and leave filter class as nil then it should return all actors that overlap with SC Collision Boundary. That’s what I want.
I would provide a class filter if I wanted to filter down to only returning a specific class of actor that the SC Collision Boundary overlaps with, but I don’t want to do that. Filter Class is optional and I want all actors that SC Collision Boundary overlaps with so I’m not providing it a value.