ProjectileMovement destroying my actors! (Gravity?)

This has something to do with gravity. I was making a grenade and when it touches the ground it just gets deleted after a short delay. I move it higher up into the air and as long as it explodes before touching the ground or very shortly after it explodes properly. Otherwise it’s deleted before it makes it to the ground and the delay doesn’t have enough time to finish.

To be clear.
Begin Play > Delay 2 seconds > Emitter > Sound > Destroy self
It gets interrupted during the delay and just poofs. No emitter or anything. Even when I remove all of my code and even start from a blank slate with a new actor this happens. I remove the projectile movement component and the problem is solved.

So I went and I grabbed a laser projectile I’d made. It’s just a static mesh (sphere) with a projectile movement component. I checked them side by side to see why that one didn’t have the problem. I disabled gravity on my grenade in the projectile movement options and BAM. Problem solved. Except uh. No gravity now. So awks.

It seems to have something to do with the object coming to a rest. I’m not certain though.

Check the box for “Should Bounce” and try again with gravity enabled.

Hello Travistyse,

If the suggestion by Black Phoenyx does not work for you, I have a few questions for you that will help narrow down what issue is it that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in clean project?
  2. If so, could you provide a detailed list of steps to reproduce this issue on our end?
  3. Could you provide screen shots of any blueprints that may be involved with this issue?

So here’s what I had to do to fix it:

  1. I had to make my Sphere mesh not simulate physics, not enable gravity, and have no collision. And no auto-weld.
  2. I had to add a Sphere Collision Component. (S.C)
  3. I had to make my sphere a child of that component ^ Or that component the root of the sphere. Drag n drop in components window.
  4. With that S.C. : Gravity on, Sim Phys off, Gen overlap events on, Collision preset: custom, Collision enabled - Query only, Object type - World Static, Everything set to block except pawn was set to ignore (probably could set pawn to block as well)
  5. Projectile Movement: Should Bounce checked, Initial speed 300, Gravity scale 1, Velocity 3 (x).

This all may not be necessary. But it’s currently working and those are my settings.

Added the first one I attempted to make by right click > Export Asset and then zipping it up. My problem is solved as far as I can tell but if it helps?

I can reproduce the issue. It’s as simple as:

  1. Create an Actor blueprint (the grenade)
  2. Add a Sphere mesh
  3. Add a ProjectileMovement component.
  4. Set the sphere mesh to simulate physics and have gravity
  5. Use it. It’ll die as soon as it comes to a rest.link text

Hello Travistyse,

I am happy hear that you have things working on your end. Thank you for the additional information. I am going to go ahead and accept your answer for this question. If the issue returns please provide any additional information that you may have and I will assist you further.

Make it a great day

Deactivate Auto Activate from ProjectileMovement

1 Like

I realize this is not the solution to this problem, but I did have a problem where when using Projectile Movement to throw a pickup, I’d spawn the pickup from the player character and the pickup would auto destroy after 45 seconds. This was the only post that’s title described my problem perfectly but was not my problem. Maybe this will help some other poor soul looking for the same solution I was.

Solution: On begin play set a delay for 5-10 seconds then get a Destroy Component from the Projectile Movement. Destroying the Projectile Movement component cancels the auto destroy of the actor.

The Destroy is being called from AActor::FellOutOfWorld().

If you’re using C++, You can derived that method to stop it getting Destroyed:

	virtual void FellOutOfWorld(const UDamageType& dmgType) override;
void ArdActor::FellOutOfWorld(const UDamageType& dmgType) {

	if(rdGetBaseActor() && rdBaseActor->rdIsActorInPool(this)) {

		rdBaseActor->rdReturnActorToPool(this);

	} else {

		Super::FellOutOfWorld(dmgType);
	}
}