Page 1 of 1

A command to check if player is crouching?

Posted: Wed Dec 21, 2005 4:04 pm
by Juutis
I was just wondering if there is a script command to check whether the player is crouching or not. I have made functional scripted weapons for my game but the problem is this: When the player stands the weapons work fine but when he crouches the shooting point stays up there where it was when he was standing. I made the system just like ZenBudha's "Perfectly functioning flashlight", I just attached a FirePoint entity instead of a SpotLight and then a little script to deal with the triggers.

Posted: Sat Jan 07, 2006 3:17 am
by ZenBudha
The reason is the flashlight is being controlled by an invisible pawn. So even though the player is crouching the pawn that the flashlight is connected to is not.

So you need to make the flashlight pawn check if the player is crouching somehow and then make it crouch.

As well I'm glad to see someone else using it for a scripted weapon as that was my original reason for getting it (with much help from others) to work in tht fashion.

Posted: Sun Jan 08, 2006 2:18 pm
by Juutis
Yeah, I managed to write a script to check if player is crouching using a pawn that shoots a projectile at the player and now my weapons work perfectly.

If anyone is interested in weapon inaccuracy and a nice kicking effect when shooting just tell me and I will be glad to help. :)