Hey, I’m trying out Box Collision in Blueprint for the first time, but I’m a bit confused on how this works.
My goals is to spawn Cube when the character enters the Box Collision and Destroy the cube when the character leaves the Box Collision.
Randomly I found the “On Component Begin Overlap (Box Collision)” node , which spawns the cube on begin overlap. Now I only need to destroy the cube when the character leaves the Box Collision
I have 2 problems:
If I search for “On Component Begin Overlap (Box Collision)” is can’t find it in the list (with and without “Contest Sensitive” enabled)
I can’t find the "On Component End Overlap (Box Collision)
I feel like its really tricky in Unreal to find nodes and how can I make this Blueprint work?
P.S. I already found a method on Box Collision joint to the Character, but I prefer to have a Box Collision joint to the object actor.
Thank you for the great explanation, I really like how you use a setter and getter, but I’m keep getting a runtime error when I leave the Collision Box:
“Blueprint Runtime Error: “Attempted to access Cube_C_5 via property NewVar_0, but Cube_C_5 is pending kill”. Blueprint: 10_Trigger_Box Function: Execute Ubergraph 10 Trigger Box Graph: EventGraph Node: DestroyActor”
My steps were:
Right click the SpawnActor Cube Return Value (Output) and Promote to Variable
I dragged to newly greated variable into the Event Graph and selected Get
I bind the getter to the DestroyActor Target (Input)
I checked online, and I believe program thinks the getter is set to a null object? I repeated the steps a few times, thinking it had to do something with naming the variable, but with no luck.
Again thank you for your reply. I removed NewVar_0, but I had no success. I rebuild the Blueprint from scratch based on your Event Graph (as close as possible) and Rebuild the level, just to in case. At the moment I walk out of the Box Collision I get the same looking error:
Yes the Cube appears when I walk into to Collision Box, and the error appears when I walk out of the box, whit the cube remaining. The My_cube_BP is just is Static Cube.
I’m not sure how to answer that, I just follow standard procedure, but I just found a hint. As I walk into the Collision Box, 4 Boxes spawn, when I move out one gets removed
Why 4 boxes I wonder?
If I replace the “On Component Begin Over (Box Collision)” with a “Event ActorBeginOver”, I believe in theory, the node is not joint with the Box Collision Object, in practice I get a error:
But if we go back to the previous example. When I walk into the wall of the Collision Box only 1 cube spawns, but if I go further more cubes spawn. Its seems “On Component Begin Over (Box Collision)” activity is handled by the Box Collision volume, not the boundary?
OMG!!! It finally works, I’m so happy right now. I want to thank you properly ClockworkOcean, for helping me along the way. I’ve learned a lot, thank you!