CastTo animblueprint, don't know what to branch with object ?

I start with the blueprint.
I want to stop the sound from a blueprint, to do that I need to read the value of a variable from an other animblueprint, I use castto but i don’t what to branch to the the object


Hi @actanse
That part is tricky ,
Basically the “Cast to” is a check on an actor, that you first need to have a reference to.
Get a reference to an actor using collisions or raycast or anything … and plug in the actor in the object. see image here

1 an actor enter a trigger, firing the event on overlap. you can pin out that actor reference and ask to unreal if is a ActorLightBob using “Cast to”
2 you use a raycast
When you cast a ray and hit an actor, from the “out hit” + “Break hit result” you can get the reference to an actor.
You dont know yet what kind of actor is, could be a monster, a player or a staticmeshActor,
so you can pin the actor and use “Cast to Monster” if the cast is success you are talking with a monster type.
Otherwise from the Cast_Failed you can try to cast again to “Cast to PlayerCharacter”

hello @Est_engine thanks for your answer, but do you have an exemple with an animnotify ? because in this case I dont know what to put with the castto animblueprint ( there is no object in this anim blueprint), but my sound variable is there… thanks