I found an “Add Box Collision” node in the blueprint. I try it out by storing it in a variable and then using the On Component Begin Overlap of this variable, but nothing happens when I step into it. Does anyone know where the problem I did wrong is?
Can I ask why you are adding box collision this way instead of adding it as a component? When I replicate this method, I am only able to generate overlap results on the new box collision component if I use “Actor Begin Overlap” instead of component begin overlap. There are a few more useful nodes you can plug in to this to test issues with the box collision. I used the bottom row here to change settings of the new box collision, and the set box extent node to make the box bigger or smaller.
Changing the box extent and setting the collision response to all channels to “Block” clearly shows that the box is being created and is working. Changing the collision response to overlap allows you to generate overlap events, but only when triggering from the actor itself, not the component.
I’m going to dig into this a bit further, and will update this thread if I find anything else.
Thanks for your reply and sorry I didn’t provide enough situations that I already tried.
I place the actor blueprint on the level. For this node, if I didn’t check “Manual Attachment”, this collision will attach to the root component by itself. So I don’t need to set up the transform for the box collision.
I set it not hidden in the game.
I tried to test this node that when you use this node, it will have default settings like, Generate Overlap Events and also set the collision presets.
And I found where is my problem. As SkyCarCaesar said, I should use the “Event Actor Begin Overlap” to trigger the overlapping instead of using “Component begin overlap”.
This part helps me out. I find out that if I use the event Actor Begin Overlap, it will show works as expected. Thank you very much.
By the way, my friend said he uses the event dispatchers bind with the function he created called “Box Component Overlap” to achieve this. Something like this:
Anyway, I now know that I have to use the actor begin overlap event instead of using the component begin overlap event.
I was trying to make several projectiles that have different sizes of box collisions. I think this way would be easier to change it during the game, otherwise, I have to create multiple blueprints for the projectiles and add the components and spawn them separately. And also use for other kinds of stuff like editable skills etc.