Advertisement

Gravity issue in Unreal Engine 4 ver. 4.19

Started by March 29, 2018 07:46 PM
8 comments, last by Jun Fan 6 years, 8 months ago

Hello all, I have just started learning with UE4 and came across  a gravity issue where my object/actor (non-skeletal) will not fall during play mode. It's placed above the terrain in the set up view before launching. The item just floats in air.

I've checked: enable gravity in the actor blueprint details menu and tried adding a rigid body (like in Unity) but found no such similar component.  

I was working in the 3rd person template area when I crossed this issue. I got curious to see if primitive objects would respond to gravity since all my character actors were behaving properly and the ones found in the geometry folder floated as well. When I tried the same test in the 1st person template the same primitive cube dropped. 

Hopefully I am overlooking something simple here but I can post screen shots with blueprints if necessary. 

 

 

Only dreamers fulfill great dreams

A common mistake I see people make when using physics objects in Unreal is they forget to make the object dynamic. Try this:

UnrealPhysics.jpg.d0cbd0b5bb2bfb547df2f4845979bc48.jpg

1.) Set the object to Movable. 2.) Enable Physics.

Also a tip: Tab_key + End_key moves the object down to the terrain, at just the point before the bounds connect. Very useful for placing physics objects; without them bouncing on start.

Advertisement

Thanks for replying Scouting Ninja I think you've got me close to resolution. In my static mesh the check box for "Simulate Physics" is greyed out and unavailable. 

 

20180329_180835.jpg

Only dreamers fulfill great dreams

Is this a blueprint?

Hi. I checked. Even when using physics in the Blueprint it still works, I also use Unreal 4.19. Try clicking on it even if it is gray.

 

Possible problems:

You turned of physics for the project- to check if this is the problem make a new Unreal project. Drag a cube in an set it's physics to true.

You don't have the Nvidia Physx driver- Download the newest driver Nvidia Physx driver and try again. 

 

You are trying to do something that isn't allowed with physics- You will need to explain in detail what you are doing so that I can help you.

Thanks again for your replies Ninja, I will write an in-depth response in the morning to elaborate further all the steps taken while creating my actor. It is possible that I am attempting to do something that's not allowed with my specific object. 

Racking my brain for the last eight hours has drained me, I'll rejoin the fight after some rest.

 

Only dreamers fulfill great dreams

Advertisement

I created this object while following a tutorial series on YouTube and it spawns from the death of an NPC/AI character's death. While watching the video I noticed that the object hovered slightly above the terrain once spawned via the npc's right foot socket. I got the same results building the item in my project so it sent me down this road to figure out why it doesn't drop and how to make gravity affect it. 

Here's a link to the video.

Hopefully this link uploads correctly, if not it is the eighteenth video in the series "Loot/Bag Pick Up Item".

I'm sure I could just use a transform offset from the foot socket to make the actor appear on the terrain but I need to learn how to apply physics in Unreal.

Now I think it will not fall properly until I enable "Simulate Physics" on the object's static mesh as Scouting Ninja pointed out. I tried adjusting the mesh's collision settings to no avail.

I also modified the AI's blueprint to try and enable gravity on the object inside the death function.

image.thumb.png.0146965dd27e7cfc62347adbcbcb2135.png

I tried to enable physics on the object inside the death function. 

image.thumb.png.df61b2bebe3cae2275370e2c485add54.png

Here's the file: LootPickUp.uasset

I may just have to build a completely different actor with inheritance from a class that has default physics. Thanks again for any help guys; as you can tell I am truly an amateur at this but I really have a dream to learn it all.

 

Only dreamers fulfill great dreams

Hi. Tried your asset and found the problem. You don't have any physics setup for that object, it's only a mesh with nothing linking it to the physics engine. You only have a collider for picking up the object and that is a trigger not a real collider.

Here is what to do: 

First setup physics for the model by creating physics collisions for it: https://docs.unrealengine.com/en-us/Engine/Content/Types/StaticMeshes/HowTo/SettingCollision

Only after you have done this, do you use it in the blueprint. Tell me if this works.

 

For testing you can just use the "cube" primitive with Unreal. It already has it's collisions setup correctly.

Thanks a ton Ninja, that explains it. I just recreated, checked physics and it dropped properly during game play. I figured I was missing something very basic. I'm sure I will be back on here soon with another questions, see you around.

Only dreamers fulfill great dreams

This topic is closed to new replies.

Advertisement