Trying to cast or connect one item to another but for this specific item I just cant figure it out, help on what I could do to connect this (and why it works) would be greatly appreated.
Hi, It’s a bit unclear with what you’re trying to do exactly.
If you want to “connect” each ground end to your remove cube you would have to hold a reference in one to the other, Either through a UPROPERTY or making one an owner of the other, which would allow you to call methods from one another.
Casting is used like you have at the start of Trigger End event, where you have an Other Actor you have overlapped with and you want to check if it is of a certain class type. The Cast will succeed if it is that class or a child of that class and allow you to call functions on the Actor related to the class you have casted to. Also, if you mouse over the NOTE in your second post is will tell you further information.
Based on my interpretation, if Remove Cube actor is used as a detection to quit the game and you want an overlap with a Ground End to trigger it, I’d Suggest the following:
- Add a Box Collision Component as a child of the Ground End Actor, this is your “Remove Cube”.
- Position appropriately relative to your Ground End mesh, and make sure collision is set to query and pawn is blocked.
- Add an On Component Begin Overlap Event and perform a cast to ensure the Other Actor is your Player Character, if valid perform the functionality from your second blueprint image.
ok so to explain what im doing basically is going to a specific spot that plays an audio then when that audio is done It sends a command sort of thing to the floor and deletes it then ends games iif that makes more sense. so im trying to figure out how to make it delete floor then quit game (end game) from it starting from a object that is different and play its own audio then send to the object that it deletes itself.
If each individual floor is it’s own actor that will detect an overlap and delete itself then what I mentioned previously will work.
I.e. you overlap with a Ground End with a Collision Box which triggers your On Component Begin Overlap (Trigger End), with your current blueprint functionality in the first image, You can insert the functionality in the second image from the Destroy Actor node onwards after the 2s Delay node.
If you want the detection to have a location declared, which when overlapped with deletes all floors of type Ground End, which looks more like what you’re doing:
You’ll want to use a Destroy Actor Node connected to the Loop Body, to destroy each array element - all the Ground End actors found.
Then on the Completed connection call the On Component Activated (remove_cube) Event from the Remove Cube reference you have there.
Let me know how you go
I should have specified that its only a singular floor that is set off Ill provide some more images to hopefully make it more understandable
These are the specific items with Final_goodbye being just a box collision and Ground_end being a singular floor piece that is deleted all im trying to do is make it when final_goodbye ends it tells Ground_end to go through its line of code and end the game
You should be able to drag off the array element and call On Component Activated (remove_cube) Directly, this will only execute for the first Ground End found, which if there’s only one it won’t matter.
add a print statement before the Destroy Actor node in the ground_end to make sure it’s being called.
Also you are destroying the actor too early, what happens after will not execute.
if you want a destruction like behaviour so the player falls through you can disable collision and set the mesh visibility to false
For a specific ground tile under the trigger just do a line trace down or drag select it in the editor.
Technically you don’t have to delete it. Just teleport it down 500m. Same effect.
End game execution needs to be called in the game mode.
Owning Controller → get game mode → call event… better to use an interface event vs casting.
Blue note means the variable your casting from is already the cast type… cast is pointless.