Remember me
Welcome, Guest
Username: Password: Remember me

TOPIC: Sprint and Crouch Help [FPS]

Sprint and Crouch Help [FPS] 7 years 3 months ago #778

  • Tyler-Broome
  • Tyler-Broome's Avatar
  • OFFLINE
  • Fresh Boarder
  • Hi, I'm Tyler. I've dabbled in music, story writing, and even coding (as you can so far tell).
  • Posts: 17
  • Thank you received: 12
I am currently working on figuring out how to sprint and crouch while viewing the camera in first person.

I am setting "Shift" to be the sprint button, and "C" for crouch.

The walkSpeed values are set from "5" to "10" when shift is pressed, and when shift is not being pressed, the value goes from "10" to "5".

As for crouch, I don't know where to start.

I am asking because I have already spent my day figuring this out! lol
The administrator has disabled public write access.

Sprint and Crouch Help [FPS] 7 years 3 months ago #779

  • ViraX
  • ViraX's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 152
  • Thank you received: 113
hi,

for "crouch system"
<Var var="crouch" value="0"/>
  <CameraController controllerType="firstPerson" collisionShape="Box" characterHeight="150" flyMode="0" collision="1" walkSpeed="7" strafeSpeed="7" name="player" mouseLock="1"/>
  <Loop isCollapse="0">
    <IfKey key="C">
      <If var="crouch" eq="0">
        <CameraController controllerType="firstPerson" collisionShape="Box" characterHeight="75" flyMode="0" collision="1" walkSpeed="7" strafeSpeed="7" name="player" mouseLock="1"/>
        <Else>
          <Timeout seconds="0.25">
            <Set var="crouch" value="0"/>
          </Timeout>
          <CameraController controllerType="firstPerson" collisionShape="Box" characterHeight="150" flyMode="0" collision="1" walkSpeed="7" strafeSpeed="7" name="player" mouseLock="1"/>
        </Else>
        <Timeout seconds="0.25">
          <Set var="crouch" value="1"/>
        </Timeout>
      </If>
    </IfKey>
  </Loop>
The administrator has disabled public write access.
The following user(s) said Thank You: Tyler-Broome

Sprint and Crouch Help [FPS] 7 years 3 months ago #780

  • Tyler-Broome
  • Tyler-Broome's Avatar
  • OFFLINE
  • Fresh Boarder
  • Hi, I'm Tyler. I've dabbled in music, story writing, and even coding (as you can so far tell).
  • Posts: 17
  • Thank you received: 12
I've played some of your games! Of course you'd know this stuff, lol

I appreciate the help! :D
The administrator has disabled public write access.

Sprint and Crouch Help [FPS] 7 years 3 months ago #781

  • Tyler-Broome
  • Tyler-Broome's Avatar
  • OFFLINE
  • Fresh Boarder
  • Hi, I'm Tyler. I've dabbled in music, story writing, and even coding (as you can so far tell).
  • Posts: 17
  • Thank you received: 12
I figured out how to do a toggle sprint with Shift!
<Var var="sprint" value="1"/>
<Loop>
    <IfKey key="Shift">
      <If var="sprint" eq="1">
        <CameraController controllerType="firstPerson" collisionShape="Box" characterHeight="120" flyMode="0" collision="1" name="player" mouseLock="1" strafeSpeed="6" jumpSpeed="7" walkSpeed="6"/>
        <Else>
          <Timeout seconds=".1">
            <Set var="sprint" value="1"/>
          </Timeout>
          <CameraController controllerType="firstPerson" collisionShape="Box" characterHeight="120" flyMode="0" collision="1" name="player" mouseLock="1" strafeSpeed="12" jumpSpeed="7" walkSpeed="12"/>
        </Else>
        <Timeout seconds=".1">
          <Set var="sprint" value="0"/>
        </Timeout>
      </If>
    </IfKey>
    <IfKey key="Shift">
      <If var="sprint" eq="0">
        <CameraController controllerType="firstPerson" collisionShape="Box" characterHeight="120" flyMode="0" collision="1" name="player" mouseLock="1" strafeSpeed="12" jumpSpeed="7" walkSpeed="12"/>
        <Else>
          <Timeout seconds=".1">
            <Set var="sprint" value="0"/>
          </Timeout>
          <CameraController controllerType="firstPerson" collisionShape="Box" characterHeight="120" flyMode="0" collision="1" name="player" mouseLock="1" strafeSpeed="6" jumpSpeed="7" walkSpeed="6"/>
        </Else>
        <Timeout seconds=".1">
          <Set var="sprint" value="1"/>
        </Timeout>
      </If>
    </IfKey>
  </Loop>
Last Edit: 7 years 3 months ago by Tyler-Broome. Reason: *Edit: Forgot to add the variable needed to make the toggle Shift sprint work.
The administrator has disabled public write access.

Sprint and Crouch Help [FPS] 6 years 4 months ago #1181

Here's a simpler version (crouch doesn't work) www.gamemaker3d.com/player?pid=052900531784
The administrator has disabled public write access.
Time to create page: 0.619 seconds