Game actors in array are not following instructions in For Each Loop. (Activate and Deactivate Issues)

ViRiX
Mon, 14 Mar 2022 06:48:37 +0000
Blueprint

Hi, I am a bit new to UE, but am working on a game where you attract objects to you. That part works pretty good.

I have a small platform that activates a power-up that allows the player to attract things from further away for a small amount of time.

Here is the collectable.

There are two collision spheres. Normally, the player interacts with the Sphere collider, but upon getting the power up platform, the Sphere is deactivated and SphereBIG is activated. The only difference is the scale.

The power-up platform’s blueprint goes like this.

I am using the Cast All Actors node so that the “potlicker”–I know, it’s a fun name–power-up can talk to all the “collectable” objects in the level at the same time. The Collectable objects never get spawned in after the level starts. They are all placed by hand.

It looks like stepping on the Potlicker platform does cause the script to iterate through all of the Collectable objects, but it seems like the spheres are not being turned on and off as instructed.

THe way it should work is that when the player overlap (step on) the platform, it deactivates the collision box on the platform, then gets all the actors in the “Collectable” class. After deactivating Sphere and activating Sphere BIG on all of the objects, it then turns off the collider on the platform , waits for a number of seconds as a sort of “cool down” then, reactivates Sphere and deactivates Sphere BIG. … but it doesn’t seem to be doing that.

When I step on the platform, Sphere BIG does not seem to be active and Sphere doesn’t seem to deactivate either.

Am I missing something?

Thanks.

21 posts - 3 participants