Hi, I want to add another Collision to the player when the moment he touches the cube the cube will get Destroy I was able to do that as soon as the player touches the cube it explodes but when I add a new collision it just doesn’t do anything what should i do?
you can do this in the hierarchy of the Viewport
hit the +Add
button select the type of collider you want “box” “Sphere”, or “Capsule”
attach it as a child to at the very highest the Capsule Collider, but you can attach it to the root it just might not rotate if you do special things to the Capsule/Mesh
I would suggest in Collision section of its own settings to Generate Overlap Events = true
(this ensures you don’t get the collider generating Block Events and making it so your character can’t touch other things)
- changing the Collision channel it is on (this can improve performance so it is only looking for specific things),
- or changing the Collision preset it uses would be of great help too (this way you can have it ignore like
WorldStatic
to also improve performance as you probably won’t care when that collider is touching a wall).
then in the Event graph right click the Collider you added (in the Hierarchy) and in “Add Event” and you will probably want “Add OnComponentBeginOverlap
” then do what you want from there
as a note you might want to also have an OnComponentEndOverlap
to undo things, like if you added an item to an array in the BeginOverlap then in the EndOverlap you would want to remove it from the array
also remember that you will only ever get the most Base version of AActor*, UActorComponent* so remember to try to cast it to something you actually care about.