Projectiles fired using physics are blown away by explosions created by the field system. This blocks attacks like a barrier.
Actors have the option to resist the effects of forces and impulses, but none of them help.
How can I solve this? It’s really annoying.
It really depends how you setup your projectile system.
So you have a field system like radial force. Physics fields have option to effect object types.
If your projectile have a different object type it won’t cause any problem
Having a custom object type for your game on projectile is a nice option.
Since sometimes some weapon will not shoot projectile but can be only hitscan.
There could be projectiles that need to be effected by physics and some not.
So you can have control over which projectile subclass does what.
Which projectile can hit other projectile type of things would be easier.
Imagine you have a crossbow that shoots arrows which can penerrate certain objects but gets stuck to enemies on hit (once). So you can tell projectile what to do if you are shooting behind a cardboard to an enemy.
Thanks for the reply.
I don’t think I’m doing anything special. It just simulates a static mesh and accelerates it. Just like any other physical object.
I was set Collision type to Projectile. But I can’t find a way to exclude this in the field system.
I didn’t use Radial Force because I thought Force Field would allow more detailed settings.
So you using physics in your projectile, that sounded to me like you really adding physics to an object that simulates physics.
If so that means this is a world dynamic object, and depending on the collisions set it reacts to world dynamic and physics body collisions. That means it is a normal behaviour.
If I understood what is going on correctly, there is couple of things you can do.
- Not using physics simulation for projectiles during flight, which is common but calculate the hit effects to have result impacts, using the projectilemovementcomponent that is very nice and extendable base.
- If the projectile you are using needs to have physics simulated then on that object you can set a custom collision and ignore physics body and world dynamic.
Things to consider:
Do you really need physics simulation on a projectile? By default UProjectileMovementComponent is incompatible with physics sim however it can do. This being said it can do majority of the common projectile movements/kinematic including bounce.
However if you need a projectile like a liquid buble, shattering fragmentation granade type of very specific its ok to use another class or existing projectile movement modification. That time the way to control what effects, what doesn’t effects you projectile physics is solely depends on the collisions as said before you need to ignore world dynamic.
After this let’s say you have a granade to throw and you really use physics for it. You throw a granade to a position and there is an another explosion happenening. I expect the granade to be nudged away atleast a bit cause it is what would be in phsyics, the shockwave and total forces acting on object results in that way and it becomes a natural part of gameplay. We can see those in majority of the new shooters.
Is there some misunderstanding? I’m talking about the Field System. The Chaos Field System. It’s not about collision.
using the projectilemovementcomponent that is very nice and extendable base.
I’m not using projectile component. There are a lot of unnecessary features, so I just use Add Force.
Do you really need physics simulation on a projectile?
Yes. Absolutely. This is a core part of my game and will not change. The work has already been completed. I just discovered a new problem and am trying to solve it.
We can see those in majority of the new shooters.
I don’t care about other games. It’s a problem with my game and I don’t need it in my game.
I understand, it is quite hard to say without knowing your system created. Just wanted to help however answer can be in your collisions and field response channels afaik.
That’s exactly what I wanted to ask. How to set up a response channel for field system. As far as I know, the collision response channel is not available for field systems. It seems that the Metadata Filter has its own response settings, but I don’t know how to apply them to the collision response settings.
I’m just using the built-in Field System. I’m not doing anything special. So it doesn’t matter what I’m creating.
I don’t blame you if you don’t have the answer. Because no one else seems to know the answer.
As I said there could be a lot of things going on depending on how the system is made and setup. What I can say on top of that that it can be achieved the expected end results you want.
I just tried in engine that my knowledge about it is still valid even though I don’t use default physics for projectiles.
Here is the setup, I just made an actor, added field system component and just added torque and metadata to it.
Here is how it works with rigid object type selected from meta data
Here is destructable type selected from meta data
notice rigid bodies not effected.
There is a lot of logic inside default engine fields actors, like shape intensity etc, however I highly recommend creating your own fields depending on what type of destructions you are making.
Let me know if this was helpfull, if not maybe somebody else has another idea.
I want to filter by object type.
My question is “How to stop the explosion from blowing away the projectile?”. Projectile collision types are already defined. Just exclude this from the field’s influence.
Metadata filters are completely useless in that regard.
Not sure to be honest, however wanted to test in a clean default template project.
a simple cube as physics enabled, projectile collision as default with an add force.
a physics field as default with metadata filter for destruction only effect (same one)
physics flight is normal on this one. If a cluster hits the projectile it is effected as you described as a new problem cause you started with field system as problem space.
however that can be also neglected as below.
make a new channel for particles , choose what channels should effect in your game.
I left ofcourse projectile channel uneffected cause it is what we want as problem space.
On your geometry collection search for collision profile per level (per destruction level what collision should behave)
Notice now also particles not effecting the flight of projectile.
However you are right that there is no much detailed information around the topic unless you deep dive into search in code or net. As mentioned its around collision and response channels and please for next time it can be more easier to help you out (if its something that anybody has info about) use descriptive problem writing and images if possible, it would be much more effective process if we understand what exactly is wrong after all understanding the problem is half solving it.
Like Grimnir said, this could be a lot of different things based on how you have it set up exactly, here is what I would check:
-Make sure the projectile actor AND the collision for the projectile are both set to “projectile”
-Make sure the field system itself AND the component itself (assuming it is set up that way) are both set to “ignore projectile”
I’m pretty sure the collision settings don’t affect the field system. I set it up exactly as you said. Guess what changed? Nothing. Nothing change. They affect everything that sets up the physics simulation.
this could be a lot of different things based on how you have it set up exactly
So you’re suspecting that something I did caused the collision settings to lose their effect? I can’t do that, and I don’t know if it’s possible. You can see what I’m doing by looking in the official documentation under Field Systems and looking at the images there.
Can you give a concrete example of what would cause this to happen?