I’m new to Unreal Engine, an I’m currently working on a top-down shooter project.
I’m using a Pawn with the Floating Pawn Movement component, and the movement is handled by add movement input.
Although, the pawn can collide with other physics objects but it can’t move them.
If I attach any collision component as the root, it interacts with the physics objects.
Is there any way that I could make the pawn move the objects?
Any help is appreciated!
What exactly do you mean by “the pawn can collide with other physics objects but it can’t move them.” How do you know it’s colliding if it isn’t moving them? Also, can you tell us what the “Collision > Collision Preset” value is set to for both your pawn and the objects you want it to move?
The collision preset for the pawn is “Pawn”, while for the other objects it is “PhysicsActor”.
I know they are colliding because my pawn hits the object and just moves along them, instead of displacing them.
are they simulating physics?
I don’t encounter this problem when I use the characters included in the First Person or Third Person templates. Can you provide steps for us to recreate the pawn you’ve created?
neither i encounter any problem. but in question he mentioned floating pawn movement.
i guess he is using something related to flying templates.
i meant the objects it’s collidng with must simulate physics
I started off with the TwinStick Project.
I added the Floating Pawn Component to the TwinStickPawn that comes with it. (I removed all the stuff that was in the event graph)
I created a controller to handle the rotation using the mouse, and the movement using the WASD keys.
The pawn doesn’t simulate physics and even if I turn that option on, it doesn’t affect the behavior.
Is it something to do with the AddMovementInput? Because in my other projects I have used AddForce and it allows me to properly interact with the objects, but in this one, it isn’t.
It is as if the AddMovementInput is not allowing the Physics to work properly.
The objects, yes. The pawn, no. And turning the option to true for the Pawn doesn’t change anything.
Yeah, they are simulating physics
It can be easily verified by shooting the projectile at them…
are you talking about the yellow boxes in the level?
they require impulse to move
the projectile in twin stick shooter had impulse feature
Yes. But shouldn’t the pawn be able to move them as well?
If we set the Pawn to simulate physics, and then use addForce to move it around, it will displace the boxes. But I don’t want to use that method as it doesn’t allow me to have much control over the Pawn’s movement as compared to the Floating Pawn Component…
Okay. I tried it, and although it is able to move the boxes, it isn’t the behavior I was looking for. (^_^)’
See, what I want is something similar to what happens when that Pawn would actually hit the box. I.e., instead of applying a constant impulse to the boxes, they would move as if a force had been applied to them by the Pawn.
You can simulate the behavior which I’m talking about by using AddForce on the Pawn to move it around and then hit the boxes with the pawn.
Okay, I’ll give it a shot.
Meanwhile, can you please try the AddForce method?
also enable generate hit events in your pawn
just do the below steps it will (increase the impulse )