Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. Help
  3. First person camera w/ mouse controls

First person camera w/ mouse controls

Scheduled Pinned Locked Moved Help
4 Posts 2 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Remi Calixto
    wrote on last edited by
    #1

    I’m making a fps (first person shooter), and I want the view to move with the mouse, but not have to click, like in free mode, have a limit to the v angle in which the camera looks at. and make the player move forward only based on the Z-rotation, not the x or y.

    CreatiCodeI 1 Reply Last reply
    0
    • R Remi Calixto

      I’m making a fps (first person shooter), and I want the view to move with the mouse, but not have to click, like in free mode, have a limit to the v angle in which the camera looks at. and make the player move forward only based on the Z-rotation, not the x or y.

      CreatiCodeI Offline
      CreatiCodeI Offline
      CreatiCode
      wrote on last edited by info-creaticode
      #2

      @remi-1286167-510cee35

      This seems very similar to the Minecraft demo, where you use “lock pointer” to control the camera view using the mouse pointer:

      play.creaticode.com/projects/660aa865b57a3da838c387bc

       
      To lock the vertical angle, a simple trick is to repeatedly set the camera’s v-angle to 90 degrees whenever it is not:

      5e72b248-fd89-46ad-9d2b-d350b5927689-image.png

      R 1 Reply Last reply
      0
      • CreatiCodeI CreatiCode

        @remi-1286167-510cee35

        This seems very similar to the Minecraft demo, where you use “lock pointer” to control the camera view using the mouse pointer:

        play.creaticode.com/projects/660aa865b57a3da838c387bc

         
        To lock the vertical angle, a simple trick is to repeatedly set the camera’s v-angle to 90 degrees whenever it is not:

        5e72b248-fd89-46ad-9d2b-d350b5927689-image.png

        R Offline
        R Offline
        Remi Calixto
        wrote on last edited by remi.1286167-510cee35
        #3

        @info-creaticode How would I change my follow camera’s v-
        rotation?

        CreatiCodeI 1 Reply Last reply
        0
        • R Remi Calixto

          @info-creaticode How would I change my follow camera’s v-
          rotation?

          CreatiCodeI Offline
          CreatiCodeI Offline
          CreatiCode
          wrote on last edited by
          #4

          @remi-1286167-510cee35

          If you use the pointer lock, the v-angle will be automatically changed. But you said you want to limit the v-angle?

          If you want it to move freely but within a range, you can still use the same block to set the v-angle whenever it is outside the range.

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • CreatiCode