I have a character called BP_FirstPersonCharacter (with a boolean variable called V_Movement) and a Collision Sphere called Movement_Blueprint, both have collisions and when they overlap, it should turn V_Movement true, but it doesn´t work. So, what should I do to turn this annoying variable true?
Show a pic of the on begin overlap event which should be triggering it.
Are you sure that the Cast is not failing?
Make sure both character capsule and the collision in movement blueprint have Generate Overlap Events checked in collision panel. May also want to get class from other actor on overlap then branch from if returned class == movement_blueprint instead of casting. Or better yet put a tag on the movement switcher and check if actor has tag, and set bool off result of that. Could get fancy later and use different tags for different movement modifiers.
The simplest way to debug is print nodes. Put one each on cast succeeded and cast failed with a helpful message.
If you never see a message, it means this event is not being executed at all; if you do, you’ll know which path.
It doesn’t replace setting breakpoints and other debugging techniques, but it’s a quick way to see what’s going on real time.
I checked, and both had generate overlap on. I also did the print nodes, and it didn´t print the message for cast fail nor the other one. So I guess the event is not even being executed. But why not, if the character is touching the collision sphere and they should be overlapping?
Are they already overlapping when you hit play?
Yes, is that the problem?
Yes, i believe that is your issue for the overlap not firing.
Aye, on begin overlap generally won’t fire when actors are already overlapping on begin play, since the overlap “began” on init before bp executes. To trigger an overlap on spawn, typically you need to do a small delay in on begin play (either delay until next tick, or just a 0.01s regular delay) then get overlappinhg actors. Or just set up the level in a way the player won’t spawn inside a trigger.
