Can someone tell me how to detect 2 inputs at a time, like (pc.KEY_SHIFT & pc.KEY_W) to run?
In your script update loop try doing this:
if (this.app.keyboard.isPressed(pc.KEY_SHIFT) && this.app.keyboard.isPressed(pc.KEY_W)) {
// run
}
2 Likes
Oh, thank you very much, this should be fantastic!
1 Like
Screenshot 2021-02-09 at 12.00.06|690x252
How can I make it to where when you run you run 2 times as fast as you walk with this script?
@Leonidas
Somewhere below you calculate the force that pushes the player forward.
Add a multiplier that increases it when those keys are pressed.
3 Likes
sorry to link my post but it had been untouched for hours
Well, one hour waiting isn’t a long time for getting an answer. Be patient, broad questions like yours aren’t easy nor trivial to answer successfully.
2 Likes
ok thanks