Hello, I’ve been making this project where lots of anonymous masks look at my mouse. I’d like to animate them on mouse click, This is my code but I don’t know why it doesnt work.
Well, i don’t think you have control of the actor for the click input to be active on it.
What you need to do is probably adjust the player controller to deal with the input and animate whatever the closest actor to the pointer is…
Perhaps a blueprint interface call to pass on the click action.
If BP mask is the actor which you have control of then I’m not sure what im looking at.
From the way the BP is setp up it would appear each mask is its own actor in 3d space…
To have multiple actors propagate to one another you should add a collision component onto the mask, so that it can detect its neighbours within a specific radius (sphere?).
From then, the same interface call can be used to run a sweep check of the area and toggle same interface call for the masks it finds, in a recursive fashion.
Only issue you need to check is the angle/position you want the actors to be at compared to the one initiating the call, so as to generate the effect in a directional way…
Just guessing, but an angle of 45deg directly away from the player’mouse may be enough based on how many actors you have in the scene.
Angle between mask and player (pointer), then any actor in the sweep who’s angle betwen it and the mask sweeping is within a 45deg X/Y position (because making it work in 3d is painful? To that effect you could probably substitute sphere collision for cilinder collision so as to be able to detect all masks up or down from the one clicked anyway)