player interaction with tunnel

Blitz3D Forums/Blitz3D Beginners Area/player interaction with tunnel

NRJ(Posted 2016) [#1]
In fps control, when the player is in front of a tunnel, I want the player to get in the tunnel only when the player is in duck mode or lie flat, and when the player is inside the tunnel he is unable to stand, how to do this????

I use the following code to make the player stand, duck, lie flat.

[code]

If keyhit(79)
pcase=pcase+1
If pcase>4 then pcase=1
endif

Select pcase

Case=1
Positionentity player, 0,2.5,0 ; stand

Case=2
Positionentity player, 0,1.5,0 ;duck

Case=3
Positionentity player, 0,0.5,0 ;lie flat

Case=4
Positionentity player, 0,1.5,0 ;duck

End select

[\code]

Thanks in advance.....


RemiD(Posted 2016) [#2]
I use a variable "PostureMode" which is either down (crouched) or up (stood up) and when crouched if the player tries to stand up, i check if there is enough space to stand up (using linepick and pickables), if yes i allow the change of posture, if no, i forbid it...