playMaker

Author Topic: Raycast and bool non true FPS Crouching[SOLVED]  (Read 911 times)

SawyerK

  • Junior Playmaker
  • **
  • Posts: 93
Raycast and bool non true FPS Crouching[SOLVED]
« on: January 05, 2020, 09:05:59 AM »
Hi everyone! I'm new to Playmaker. I trying to make an FPS controller, but i stuck at the crouch mechanic. Without the bool, it works fine (press CTRL crouch, press CTRL again stand) but i wanted to add a raycast that checks if something is above the player, and doesn't let the player stand up. I use bool non true to check if nothing is above and the CTRL is pressed, then it can stand up. But it doesn't seem to work because as i press the key it sends the state right back to the standing position.


« Last Edit: January 08, 2020, 07:30:18 AM by jeanfabre »

Stain Corb

  • Junior Playmaker
  • **
  • Posts: 69
Re: Raycast and bool non true FPS Crouching
« Reply #1 on: January 06, 2020, 11:12:51 AM »
Hi I am also new to Playmaker, but what I would do is,

1-Add a new event where it can check if it can raise, add your array to this one, and if it check that it should not raise it will just go back to the crouching event.

2-In theory you would have a check event that will just control if it should ether stand or stay the same when you release CTRL button.

Please tell me if this makes sense.

I hope this helps, Nice thing about code is there are so many different ways to do the same thing.


SawyerK

  • Junior Playmaker
  • **
  • Posts: 93
Re: Raycast and bool non true FPS Crouching
« Reply #2 on: January 07, 2020, 08:39:13 AM »
Thank you for your reply!
Your method is good, but i found an even easier solution.
Just put the raycast on the standing state, so when you try to stand up and something is above you it sends you right back into the crouching state. :D