P_(Insta)Thrust and setting momz while the player is on the ground issue

Status
Not open for further replies.
Also applies to P_InstaThrust.

Example code of the issue at hand:
Code:
if (player.cmd.buttons & BT_CUSTOM1)
        P_InstaThrust(player.mo, player.mo.angle, 35*FRACUNIT)
        P_SetObjectMomZ(player.mo, 15*FRACUNIT, true)
end
To replicate: merely tap custom button 1 while on the ground, and the player will thrust forward at 35 fracunits as specified, and the player's momz will be set at 15 fracunits, which launches the player up into the air...

...then the player's momx and momy will just simply stop while in the air after a certain distance (which is very short).

Example GIF attached. As you can see in GIF, the player will be thrusted forward for like a fracunit, then just completely stops.

Also possibly related to this issue: Use P_Telekinesis on another player, and no matter what the force of it is, the player will stop still after a certain distance if the player is on the ground. They won't slide.
 

Attachments

  • srb20003.gif
    srb20003.gif
    6.6 MB · Views: 402
My test script only runs that code, but uses MobjThinker instead...

Aha, I see what's happening.

I switched my script over to ThinkFrame and it functions correctly...so this looks like some issue with MobjThinker rather than a physics issue.
 
Last edited:
If you're returning true in MobjThinker, you're not running the standard physics code for momentum-handling. That could be what's going on.

...though in the player's case, returning true for MobjThinker acts just like return false/nil anyway. So I'm not entirely sure really.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 0, Members: 0, Guests: 0)

Back
Top