Can't change jump height in a 2D sidescroller

Hey ,

Because you are destroying the Actor with DestroyActor before changing jump height, you will get an error because that Actor is pending destruction (waiting to be destroyed).

If you want to change these values, either don’t destroy the Actor or do it after you change the settings.

I’m trying to make a power up that changes character jump height. The blueprint for it is being scripted in the character blueprint itself (not sure if that is what’s giving me the error or not, just thought it was worth mentioning)

When I run the game and collect the power up, I get this error message:

This is how my blueprint is set up:

The way it’s supposed to work, is when the character collides with the powerup, the character destroys the power up, and then gets a jump boost. But for some reason the game crashes when I run into the jump boost powerup and i’m not sure why. I have this same exact setup with a different powerup, but it changes the Walk speed instead, and it works flawlessly.
Any ideas?

UPDATE: I just realized I can click the links in the error message. If I click the link for the node receiving the error, it highlights the “SET” node right after the Set Timer by Function Name node. I’m a noob at this so I’m not too sure what that means, but any help would be appreciated.

I moved the “Destroy Actor” node to right after the last “Set” node, where the velocity is meant to go back to normal, and the game still crashes… like, it’s a 2d game and the camera goes tilted instead of staying along the y axis. It just doesnt crash until after the actor is destroyed. Is there a way to remove the object, without destroying the entire actor? I feel like destroying the whole thing i what’s causing my issue (but I can’t be sure about that, since I’m new to this)

Can you explain why you are destroying the Actor? I don’t understand why you’d want to destroy it and then set values.

It’s a powerup. When you touch it, it disappears and you get increased jump for 20 seconds. I don’t want the powerup to be available continuously, so it needs to disappear when you touch it.

Oh, it looks like you are destroying your Character instead of the Pickup.

Are you calling Destroy Actor in your Character Blueprint or in your Pickup Blueprint?

in the character blueprint. But I have two other pickups that are setup the same exact way and they work fine. Wierd… is there a way to keep it in the character blueprint and just reference the actor I want destroyed?

I just realized the difference… I derped… i have a target reference for the other 2 “destroy actor nodes”. I think I will delete this question to hide my shame. xD

No worries, everybody makes mistakes.

Please don’t delete the question. It may help other people in the future.

Thanks.