Duck Game

Duck Game

View Stats:
꧁Kritzy꧂ 22 Apr, 2018 @ 8:27am
Can Duck Game test for a different button press than Primary fire?
OnPressAction(), OnHoldAction() and OnReleaseAction all test for when the Primary Fire is either pressed, held or released (Makes sense)

But can i also test if another button is pressed? Like when you quack? Or maybe OnRightPress?
I tried OnPressAction(Q) but that didn't work.

Thanks in advance :senpai:
Last edited by ꧁Kritzy꧂; 23 Apr, 2018 @ 7:54am
Originally posted by Armenian Cory:
Try this:
public override void Update() { if (duck != null && duck.inputProfile.Pressed("INSERTKEYHERE")) { CodeGoesHere(); } base.Update(); }

this makes the weapon check if it's being held by someone, and if it is, then checks if the holder is pressing a certain key. But the duck's input is only limited to these controls:
"LEFT" "RIGHT" "UP" "DOWN" "JUMP" "SHOOT" "GRAB" "START" "RAGDOLL" "STRAFE" "QUACK" "SELECT" "CHAT"
< >
Showing 1-5 of 5 comments
Lily 22 Apr, 2018 @ 9:06am 
in update:
if (inputprofile.pressed("WHATEVER")) {
dosomething();
}

(don't forget the base.update)
꧁Kritzy꧂ 22 Apr, 2018 @ 9:16am 
"The name 'inputprofile' does not exist in the current context"

Creating a new field won't work either, because then it says "Object does not contain a defenition for pressed"

Current code:
public override void Update() { if (inputprofile.pressed("Q")) { CodeGoesHere(); } base.Update(); }
Last edited by ꧁Kritzy꧂; 24 Apr, 2018 @ 8:14am
꧁Kritzy꧂ 30 Apr, 2018 @ 7:02am 
sooo... Did i mess something up? I don't see what i missed
The author of this thread has indicated that this post answers the original topic.
Armenian Cory 31 May, 2018 @ 8:51am 
Try this:
public override void Update() { if (duck != null && duck.inputProfile.Pressed("INSERTKEYHERE")) { CodeGoesHere(); } base.Update(); }

this makes the weapon check if it's being held by someone, and if it is, then checks if the holder is pressing a certain key. But the duck's input is only limited to these controls:
"LEFT" "RIGHT" "UP" "DOWN" "JUMP" "SHOOT" "GRAB" "START" "RAGDOLL" "STRAFE" "QUACK" "SELECT" "CHAT"
꧁Kritzy꧂ 31 May, 2018 @ 9:08am 
Originally posted by ArmyteCel:
Try this:
public override void Update() { if (duck != null && duck.inputProfile.Pressed("INSERTKEYHERE")) { CodeGoesHere(); } base.Update(); }

this makes the weapon check if it's being held by someone, and if it is, then checks if the holder is pressing a certain key. But the duck's input is only limited to these controls:
"LEFT" "RIGHT" "UP" "DOWN" "JUMP" "SHOOT" "GRAB" "START" "RAGDOLL" "STRAFE" "QUACK" "SELECT" "CHAT"
Hey, that seems to have done it! Thanks a lot. :senpai:
< >
Showing 1-5 of 5 comments
Per page: 1530 50