We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

First Person Walking with Keyboard Controls

Home Forums Puzzles First Person Walking with Keyboard Controls

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #79571
    albi
    Participant

    I am trying to create a first-person walking experience where a character’s walk animation is triggered by pressing a specific key on the keyboard. The camera should follow the character from behind, similar to how it works in many video games. However, I do not want to parent the character to the camera, as I want the user to have the ability to rotate the camera around the character, allowing them to view the front of the character and the surroundings (like in GTA games). Additionally, the character should always stay on the floor.

    ### Key Queries:
    1. How can I assign specific keyboard keys to trigger actions using puzzles in Verge3D?
    2. How to do the first person character walk properly like in video games using Verge3D?

    Thanks in advance.

    • This topic was modified 16 hours ago by albi. Reason: typo
    #79577
    c4cc
    Participant

    Pardon if this isn’t exactly spot on, but full credit to kdv for teaching me the basics of keydown here

    https://v3d.net/o2p

    and if necessary, logic puzzles

    If necessary? :scratch: Without logic puzzles you will do nothing.

    • This reply was modified 7 hours, 56 minutes ago by c4cc.
    #79579
    c4cc
    Participant

    While kdv must absolutely be credited for teaching me the fundamentals of keydown/up events, here’s the puzzles for keydown/up events for movement I ended up with eventually. Just change “up” to “forward”, and “down” to “back”

    ol4x1

    Also, assuming you’re using Blender…

    speaking of 3d camera view, a la GTA games, the camera has to be moved around together with the playable character via the above controls, too. Here, the puzzles do so:

    ol4x1

    Meanwhile, in Blender, the camera verge3d setting must be this, so camera may be controlled via mouse:

    ol4x1

    • This reply was modified 7 hours, 35 minutes ago by c4cc.
    #79581
    kdv
    Participant

    I want the user to have the ability to rotate the camera around the character, allowing them to view the front of the character and the surroundings (like in GTA games). Additionally, the character should always stay on the floor.

    why not? quite possible. and even without JS coding ))) but the First Person camera controls won’t do. you’ll have to create your own controls. somethig like shown above…

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.