Maybe I wasn't clear enough about the local force. Leave out the reference to the x, y coordinates, as the xlocal, ylocal arguments of the function is relative to the x of the object. So:
var force = phy_mass * 5; //replace five with the acceleration you want in meters/second squared.
phy_apply_local_force(-64, 0, force, 0);
You will want to make force negative to go in the opposite direction.
Regarding the impulse, it's behaving as it should, and your confusion tells me that you really haven't put time into understanding how the physics properties affect the objects. Angular impulse just affects the rate of rotation, regardless of any forces currently acting on the object, so if you apply an impulse of 10, you are really setting the rate of rotation to 10. However, while impulse sets the object in motion, the damping is what will stop it. If you want your tank to stop turning when the key is released, increase the angular damping.
In addition, the density property does not indicate the mass of the object, but how dense it is, and is used by the simulation to calculate the phy_mass property. Density = Mass/Volume.
I just read about phy_mass on the manual and it made no sense to me. Why is this needed here? Although it enabled forwards movement, so thanks for that, however when I set it for the Down arrow backwards (yes, as you said, I set it to be phy_apply_local_force(-64, 0,
-force, 0); ) yet still it just rotates instead, strangely. And I thought I needed to set this at the create event, but apparently not (game crashed) so I placed all of this in the step event and it works fine.
Increasing angular damping will simply make the maximum rotation slower (and if it's the same number as the impulse, you will not be able to rotate it at all). Okay, let me demonstrate. Normally, this is what would happen in terms of rotation, right (in terms of, lets say degreese per second or something like that)
0, (rotation key pressed) 2, 4, 8, 16, 32, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, (rotation key released) 32, 16, 8, 4, 2, 0.
What I want happening (and I am pretty sure this is possible when it comes to physics as TO was able to achieve this as well) is:
0, (rotation key pressed) 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, (rotation key released) 0.
And I have not found any means to get this work right when physics are enabled.
Edit: Never mind the part about rotation. I fixed it by increasing damping AS WELL AS force/acceleration
though the backwards movement is still a spastically rotational one
Another Edit: Apparently there was a glitch in the way the hull behaved (glitch in the engine I would guess). Everything was left the same and I double checked for that. After I deleted the Down arrow key's code and pasted the Up arrow key's code back in and set the force to -force, everything went as intended. Sincerely thank you,
@Jezla . I'll get on with Turret movement now (I seem to have trouble syncing the rotation of both entities in such a way that when Left or Right key is pressed, both the hull and turret move in sync, however whenever Z or X is pressed the rotation is only applied to the turret). Also it seems like physics aren't really working as I wanted to whenever I am at about 45 degrees turned and hit a wall, press the forward backward button (depending on whether the back's or the front's corner has hit the wall) as well as a rotation button; it instead rotates the wrong way and then the whole thing flops with a full front/back edge facing the wall instead of it sliding off to the side. This might become major later on, although for now is fine and I'm not entirely sure if it's possible to change this, since it's physics that are determining this collision. Again, sincerely thank you for your help. And to anyone else who helped me get the movement and collision working almost as intended with physics