Download

Very tricky! projectile to hit actor that doesn't have simulate physics enabled

Hi everyone

This is quite a tricky one and I have noticed multiple people have experienced trouble with this area based on the feature request section.

I’m going to keep this as brief as I can. I’m trying to create an enemy AI, all it does is rotate to face you and fire projectiles. I don’t want this AI to simulate physics because I don’t want the projectiles knocking it back or moving it in any way. I just want it to acknowledge when it’s been hit to reduce health.

For reasons I still don’t understand, Unreal Engine doesn’t allow collisions with actors that don’t have simulate physics enabled. There is only one way around this, which took me hours to find yesterday, which was to replace the DefaultSceneRoot component with the sphere mesh in my projectile blueprint (by dragging the sphere onto the DefaultSceneRoot). Doing this is the only way to have non physics simulating actors register collisions with my projectile to my knowledge, but now I face a new problem.

When I replace the DefaultSceneRoot component with my sphere mesh (as is necessary to make it work), it scales up the mesh drastically, there doesn’t seem to be any combination of ways to address this, I can scale the mesh first, I can scale the DefaultSceneRoot first before replacing it, I can scale them both or just one and not the other, but regardless, as soon as I replace the DefaultSceneRoot with the sphere, the sphere automatically scales up and cannot be changed in the settings, so instead of firing a small energy beam, it looks as if my controller is throwing an exercise ball…

That’s not true at all :stuck_out_tongue:

Physics simulation doesn’t have to be enabled for collisions.

Also I would recommend using the Overlap instead of Blocking logic for bullets. So it’s not a real collision but an overlap, after which you then can trigger the impact FX and destroy the projectile.

Hi MyKonCodes

thanks for your response!

I had attempted an overlap > cast to projectile > print string event last night, but I forgot to set it from “Block” to “overlap” for my custom projectile collision type.

Thank you for saving my project! :smiley:

There is an underlying nuance here that is the root cause of confusion sometimes.

The underlying issues has to do with PhysX itself.
In PhysX, there are 3 types of bodies: Dynamic, Kinematic, and Static.

Due to the implementation which I wont get into here, there are rules regarding collision between these types of bodies.

UE uses a slightly different abstraction, and there are a few settings that affect the underlying PhysX body:

If Simulate Physics is on == Dynamic
If Mobilty is Movable == Kinematic
If Mobility is static == Static

If one or both bodies is Dynamic, then collisions occurs.
If both are static then no collision occurs.
If one is kinematic and the other is Kinematic or Static, then you must move the kinematic with Sweep checked.

Remember, since the only way to move a Kinematic body is by changing its location, you must check the Sweep to receive collisions.

I have been working on a blog post covering this in more detail that I hope to finish and will link to eventually.

Happy Coding

Hi OptimisticMonkey

Thank you for your input. It’s nice to know that the issue is being looked at. I’m lucky that my issue was simple enough to be resolved but I imagine for larger projects and for more experienced users, this may pop up as a problem in their work. At any rate I will remove this thread now it has been resolved to clear room for others.

Don’t remove this thread, all threads have the chance of helping someone else out in the future.

Ah ok no problem!

Definitely interested in reading your Blog sometime @OptimisticMonkey:slight_smile:
It’d be great if it covered areas that aren’t explained well or holistically…
My case: Spaceships using Physics / Non-Physics / Hybrid movement.

To gain a deeper understanding of Collision Presets: Query & Physics etc…
Physics-Only/Query Only? Object Types: World-Dynamic / Physics-Body…
Especially with-respect-to UseSimpleAsComplex vs. UseComplexAsSimple.
Leading up to understanding the implications of adding ‘Simulate Physics’…

1. For when ships are powered by Physics i.e. SetPhsyicsLinearVelocity etc.

2. Or when movement is Interpolated, but with Physics Simulation enabled.   
(AddActorWorldOffset and SetActorRotation / SetActorRelativeLocation etc).

3. Or when using Interpolated movement but Physics Simulation is disabled...

I’ve no good understanding of how Sweep works in any of these 3 scenarios…
Or info on how collision, performance differs beyond trying things empirically.
Many Nodes also support Teleport. Every gamer knows what Teleport means.
But what does it mean in these 3 specific scenarios? Epic’s docs lack detail…

I mostly associate Kinematics with Character Animation / Movement IK etc…
Can Kinematics usually be simplified to just mean Interpolated Movement?
In the real world Kinematics generally means the study of all object motion.
But in game work, things tend to get a little glossy eyed and confusing etc.

Definitely interested in reading your Blog sometime @OptimisticMonkey:slight_smile:
It’d be great if it covered areas that aren’t explained well or holistically…
My case: Spaceships using Physics / Non-Physics / Hybrid movement.

To gain a deeper understanding of Collision Presets: Query & Physics etc…
Physics-Only/Query Only… Object Types: World-Dynamic / Physics-Body…
Especially with-respect-to UseSimpleAsComplex vs. UseComplexAsSimple.
Leading up to understanding the implications of adding ‘Simulate Physics’…

1. For when ships are powered by Physics i.e. SetPhysicsLinearVelocity etc.

2. Or when movement is Interpolated, but with Physics Simulation enabled.   
 - (AddActorWorldOffset / SetActorRotation / SetActorRelativeLocation etc).

3. Or when using Interpolated movement but Physics Simulation is disabled...

I’ve no good understanding of how Sweep works in any of these 3 scenarios…
Or info on how collision, performance differs beyond trying things empirically.
Many Nodes also support Teleport. Every gamer knows what Teleport means.
But what does it mean in these 3 specific scenarios? Epic’s docs lack detail…

I mostly associate Kinematics with Character Animation / Movement IK etc…
Can Kinematics usually be simplified to just mean Interpolated Movement?
In the real world Kinematics generally means the study of all object motion.
But in game work, things tend to get a little glossy eyed and confusing etc.

Definitely interested in reading your Blog sometime @OptimisticMonkey:slight_smile:
It’d be great if it covered areas that aren’t explained well or holistically…
My case: Spaceships using Physics / Non-Physics / Hybrid movement.

To gain a deeper understanding of Collision Presets: Query & Physics etc…
Physics-Only/Query Only… Object Types: World-Dynamic / Physics-Body…
Especially with-respect-to UseSimpleAsComplex vs. UseComplexAsSimple.
Leading up to understanding the implications of adding ‘Simulate Physics’…

1. For when ships are powered by Physics i.e. SetPhysicsLinearVelocity etc.

2. Or when movement is Interpolated, but with Physics Simulation enabled.   
 - (AddActorWorldOffset / SetActorRotation / SetActorRelativeLocation etc).

3. Or when using Interpolated movement but Physics Simulation is disabled...

I’ve no good understanding of how Sweep works in any of these 3 scenarios…
Or info on how collision, performance differs beyond trying things empirically.
Many Nodes also support Teleport. Every gamer knows what Teleport means.
But what does it mean in these 3 specific scenarios? Epic’s docs lack detail…

I mostly associate Kinematics with Character Animation / Movement IK etc…
Can Kinematics usually be simplified to just mean Interpolated Movement?
In the real world Kinematics generally means the study of all object motion.
But in game work, things tend to get a little glossy eyed and confusing etc.

I’ve been messing with various solution to get my projectiles with movement component based movement, and without physics enabled, do collision.

What I did was use a beginoverlap node to trigger my other nodes, and this would only work (as the beginoverlap + button describes when you hover over it with the mouse) when the object the projectile comes in contact with has “generate hit events” enabled. This was the only way I could this stuff working without physics which affects projectile trajectory.