Author Topic: How can I disable jumping but enable swimming?  (Read 2080 times)

Code: [Select]
datablock PlayerData(PlayerLI : PlayerStandardArmor)
{
canjet=0;
firstPersonOnly=0;
jumpForce = 0 * 0; //0 * 0;
uiName = "LegoIsland Player";
};


This playertype completely disables jumping but it also disables the ability to swim. Meaning I can't swim to the bottom anymore. Is there a way I can disable jumping but allow swimming?


this forum is so slow bumps don't do a thing

this is a theory about your problem not necessarily meant for you (it isn't specific enough to be helpful, i think), but could one parent the function that is called when jumping to only work when in the water?

this forum is so slow bumps don't do a thing

this is a theory about your problem not necessarily meant for you (it isn't specific enough to be helpful, i think), but could one parent the function that is called when jumping to only work when in the water?
Unfortunately no. The callback is called whether or not the player even jumps, and can't be used to prevent jumping.

What he could do though, is use said callbacks to add up or down velocity to the player.

Unfortunately no. The callback is called whether or not the player even jumps, and can't be used to prevent jumping.

What he could do though, is use said callbacks to add up or down velocity to the player.

How can I do that for water?

just change the datablock to a copy with jump enabled when you enter water and change it back when you leave water.

just change the datablock to a copy with jump enabled when you enter water and change it back when you leave water.
well stuff that's a simple solution to this

just change the datablock to a copy with jump enabled when you enter water and change it back when you leave water.
Genius.

just change the datablock to a copy with jump enabled when you enter water and change it back when you leave water.

How would I do that then?  I'm using environment water.

How would I do that then?  I'm using environment water.
There is a player::onenterliquid and a player::onleaveliquid, so package that and change the datablock when it gets called.
« Last Edit: March 02, 2014, 06:00:41 AM by Zeblote »

There should also be a player::onexitliquid, but I'm not sure about that one.
No. It's player::onLeaveLiquid.



It's not working for me I may be doing something wrong.

It's not working for me I may be doing something wrong.
post your code or we can't help you