Hello, I have a problem in my BP with when character drops the item.
BP that I have raised is, when the character drops an item (is an Actor) on a table (contains a collision box), it has an object overlap with the box, then it will recognize the item name and compare it with a variable and print to the screen if it is correct or no.
The problem is that when it drops an item, BP does not work from the beginning, that is, “in component starts overlay (box)” it does not activate.
I haven’t been able to solve this problem. I do not know if it is a BP problem that I have raised or it is due to configuration.
@INKLEAFS Hey, make sure you have enabled GenerateOverlapEvents (probablemete llamado algo como “Generar eventos de superposición”) on the collision tab in the details panel of your box componente. You should also make sure that your that your collision presets allow your components to interact.
The first variable in the following picture should be checked to allow the OnComponentBeginOverlap to be called. Also check the collision presets to make sure that your actors/components are able to interact with each other.
This link is also useful to see how collisions work.
Another thing, I think you will always print “Incorrecto” in this case, because Unreal is likely to modify the name of the actor to something like “Wood_0” for example, so i would suggest first printing the name of the actor directly to see what you are dealing with and then handle that.
Is the item attached to the character prior to drop?
Generally actors attached to a pawn have collision disabled. When dropped (literally) collision needs to be reenabled and usually sim physics is turned on.
If your drop mechanic is technically spawning an actor at a point in world space (inside the collision), then the begin overlap will not trigger. The actor has to be spawned outside of the collision and pass through its bounds to trigger on Begin or on End overlap.
Potential solution… or at least a good learning exercise.
scale your table overlap collision down to about 10cm in height. Spawn your item 20cm above the box, enable physics and collision.
This should trigger the overlap if collisions are set up correctly.
You can ultimately scale the box collision to be only 1 or 2 cm above the table surface. In the item BP have it disable physics on overlap of the box. This will put your actor at rest, so it doesn’t bounce off etc.