Detecting Keypress

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

SoSilencer

Harry Goz (1932 - 2003)
Nov 27, 2000
834
0
0
42
unrealdev.net
This should be really simple but I just can't figure it out.

How do you detect when somebody is holding down a button?

What I'm trying to do is code a new trigger which, when the player is within the trigger radius and jumps, they move up at a slow rate. When they press duck, they move down at a faster rate. When they don't press either, they stay at the current height that they are. This is to simulate climbing a rope, jump climbs up, duck slides down, nothing holds where you are. I just can't figure out how to detect jump and duck though, so I can't make it work. I'm not sure if trying to make it a trigger is the problem. Perhaps I need to do this with a new zoneinfo class?

I also am trying to disable certain keys, mainly fire and altfire since it's pretty hard to shoot a gun when you're climbing a rope. Any help is really appreciated.
 

Smoke39

whatever
Jun 2, 2001
1,793
0
0
I don't know much about mapping, but it sounds like you need a new ZoneInfo. I also don't know how any map stuf checks if a pawn is in it, but with weapons, you can use if (Pawn(Owner).bDuck == 1) to check if the weapon's owner is pressing duck. I don't know how to check for jumping. Hope this helps a bit...