Download

Customizing movement and physics...

So the end result I am looking for is a floating / flying destruct-able mesh that rotates independent of its trajectory and only accelerates in the direction it faces when the thrust key gets pressed. Like the ship in Asteroids or a dozen other '80’s arcade games. I also need it to bounce off walls and detect collisions with other pawns (the AI bad guys and their projectiles).

Over the course of the last month I have been able to get ALMOST all these things to work together but it seems like every time I get close things start to unravel: I can get exactly the movement I am looking for from a character pawn with the add rotation and add movement functions but physics simulation stops that. A base pawn works better with the physics simulation but I cannot get forward movement to happen… actually I did get it to happen the other night (somehow) with the AddImpulse function but then the camera refused to stay with the pawn.

Tonight as I get close I’ve lost yaw and thrust control for some unidentified reason (but pitch still works?!?).

So… I am frustrated, confused and wondering if anyone might have an idea about how I would do this stuff.

it seemed so simple when I thunked it up :frowning:

TIA!!!
Moose

errrr… that’s a lot of information to take in… maybe a pic of what you are doing, not a page full but the nodes & areas that you are having problems with, maybe.

not sure I personally could help but it would help to understand the problems you are going through & what exactly you are trying to do.

For the purposes of explaining myself better I have started with a Flying Template.

First I add a physics volume (18000x25000x5000) and set it as a water volume and center it on the map.

Next I re-parent the BP_Plane blueprint to a character and set its max swim speed to 4000.

Next I delete everything in the graph but the input events… for MoveUp and MoveRight I call AddWorldRotation with up plugged into pitch and right plugged into yaw. For Thrust I call AddMovement with GetForwardVector plugged into World Direction and the thrust axis value plugged into scale.

This gives exactly the movement I am looking for. (I can also do this without the physics volume if I set gravity to 0 in the world settings.)

When I run into something I can slide across it but not bounce off it. I am looking for the bounce.

So I go back to the BP_Plane blueprint and check the Simulate Physics box under the Root Capsule Component… this is where things start going badly.

I dont get how the physics sim makes everything go bonkers… any ideas?

Okay, after much ado I now realize what is happening. Angular Dampening set to, oh… 1.5 - 2.5 keeps the ufo from flying off wildly when enabling physics sim. As for movement I have deleted the physics volume created above (that was to illustrate the movement I am looking for) and also re - parent the BP_Plane back to a Pawn (since I wont be needing character movement now).

So my problem is figuring out where to fire an impulse (which is not attached to anything) in world space to give the illusion of a thruster… by subtracting the ForwardVector from the WorldLocation I come up with a point right behind the ufo. I had to add back a slight offset to get the thing to fly strait. But it works and I bounce off the walls like I wanted.

Couple things about Impulse: remember it affect all physics enabled actors… so if it has a 100 radius and its moving around… you get the point. also firing an impulse can trigger destructable meshes… so having my destructable mesh as the thing being moved prolly aint gonna work so good.