Applying gravity to a spawned item pickup

The Launch node only works with Character Movement Component so it will not cut it here as the star is just a plain actor, that’s OK.

Skip the Set Simulate and Launch nodes and do instead in the Star Blueprint:

  • make sure the star mesh is the root (drag and drop it on the root)
  • tick Simulate Physics
  • ensure Collision Preset is set to Physics Actor

And then in the star’s graph:

We pick a direction in a 30 degree cone facing up (to make it jump out look a tad more interesting) and use the resulting vector as physics push in that direction with a magnitude of 500. Make sure you tick Vel Change tickbox there.

You should end up with something along the lines:

Image from Gyazo

Do note that in your example you’re spawning the star at the exact location of the item container (?); if the container is still present when the star appears, both object might collide prematurely giving you weird results.

Do tell if you get it going.

So recently, I’ve been trying to make a item container that when destroyed would make a item pickup appear, in case a green Star Gem for reference sake, with the item bouncing into the air upon being spawned before falling to the ground.

behavior would differ from item pickups not in a container in that their standard behavior is to float in the air, unaffected by gravity. I had hoped that by attaching a Simulate Physics node to the Spawn Green Star Gem event that it would allow the new green Star Gem item pickup to be affected by gravity and fall to the ground after being spawned.

Unfortunately, instead the newly spawned item just floats in the air like its non-container brethren.

Additionally, I can’t get the newly spawned item to bounce into the air immediately after being spawned either as I can’t seem to figure out how to get the Launch Character event to target the item spawned.

Does anyone have any idea of what I’m doing wrong?

EDIT #1: I managed to get Simulate Physics working on the falling collectible but after doing some tests, I don’t think enabling physics is the way forward.

The test that made me reconsider using physics was one where I positioned a platform underneath the falling collectible in a way that the very edge of the collectible would hit the platform in order to see how that would affect the way that the collectible would land. The end result was that the collectible ended up bouncing into the background of my level where my character wouldn’t be able to reach it.

Instead I was wondering if it is at possible to assign gravity to the collectible but not physics, as the player character and the enemies I’ve created thus far all obey the law of gravity but otherwise do not have any other physics assigned to them.

The player character and the enemies are all of the “Character” class while the collectible is instead of the “Actor” class, is that an issue? Or is there a way to assign gravity without enabling physics to a object of the “Actor” class?

EDIT #2: One issue that I’ve been having & should have mentioned before, is that while I have physics enabled for the spawned item, the player cannot collect the item when they touch it, with the item bouncing away instead. I’ve tried changing various Physics settings but nothing seems to allow the player to be able to overlap the item while simultaneously maintaining physics for the item.

Just for reference, here are the collision settings for the non-falling item pickup:

And here is the collision settings for the falling item pickup:

Sorry for the extremely belated response. I got sidetracked working on other areas of my project, anyways, I’ve been unable to check the Simulate Physics box within the Physics tab. Evidently, the collectible needs some sort of collision in order to simulate physics, which it currently does not. I tried selecting Custom collision and played around with the settings a bit to see if I could get it to work, but to no avail.

You can generate collisions in the static mesh editor, do them in the 3D modeling software (see static mesh FBX pipeline documentation) or add a separate collision mesh component in the blueprint.

Sorry for the belated response, anyways, I’m not really sure what you mean by .

296582-collision-mesh.png

The item pickup already has a collision box, unless you meant something else?