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 15 posts - 1 through 15 (of 19 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 1 month, 3 weeks 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 1 month, 3 weeks 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 1 month, 3 weeks 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.

    that’s 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.

    #79582
    albi
    Participant

    here’s the puzzles for keydown/up events for movement I ended up with eventually. Just change “up” to “forward”, and “down” to “back”

    A huge thanks for your time and effort you have put to this. Since I’m not familiar with most of the puzzles you have shown, I’m going through user manual and studying all those puzzles one by one and trying it out. I just want to understand how this works and what’s happening rather than just copying those puzzles as it is.

    that’s quite possible. and even without JS coding

    @kdv That’s pretty much from the attached YT video I want to achieve.
    Also how can we trigger multiple animations of the character to assign in various events. In the video you have shared, I’m seeing an idle animation and walking animation in the same character in different scenarios.
    I have tried this but Verge3D seems to recognize only animations to a mesh, not importing multiple strips or actions from Blender.

    Also, can u share the puzzles tree of the application in YT video if you have it. Sorry if I’m asking for too much.
    Thanks so much.

    #79583
    c4cc
    Participant

    that’s 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…

    From my experience, leaving camera Verge3d setting as “orbit” allows the camera angle to be manipulated via mouse, a la FPS shooter, doesn’t it?

    • This reply was modified 1 month, 3 weeks ago by c4cc.
    • This reply was modified 1 month, 3 weeks ago by c4cc.
    #79586
    kdv
    Participant

    I’m seeing an idle animation and walking animation in the same character in different scenarios.

    https://www.soft8soft.com/topic/verge3d-tools-plugin/page/2/#post-67807
    Example https://v3d.net/16lg

    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.

    #79599
    albi
    Participant

    Hi kdv, Thanks for the response.
    I this achieved by using any plugins? cz I’m not seeing some of the puzzles from the image you hve shared.

    #79600
    albi
    Participant

    the camera has to be moved around together with the playable character via the above controls

    As far I understood, you are only moving the camera left and right, Isn’t it?
    I’m trying to create a character that moves left, right, forward nd backward. So, is it the same method I need to repeat to give forward nd backward cam movement with the character?

    • This reply was modified 1 month, 3 weeks ago by albi. Reason: typo
    #79602
    kdv
    Participant

    Only one puzzle is not standard and it’s not important in your case. This puzzle is just used for smooth cross-fading…

    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.

    #79603
    albi
    Participant

    Only one puzzle is not standard

    I not able to find “set effective weight for animation” puzzle also. what about that?

    #79604
    kdv
    Participant

    Only one puzzle is not standard

    set effective weight for animation

    all the rest puzzles are standard ones.

    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.

    #79606
    c4cc
    Participant

    As far I understood, you are only moving the camera left and right, Isn’t it?
    I’m trying to create a character that moves left, right, forward nd backward. So, is it the same method I need to repeat to give forward nd backward cam movement with the character?

    Yeah, my camera’s moving left and right.

    In your case, you want the camera to be controlled gta style.

    So your camera must be moved forward and backwards via player controls as well, with “orbit” setting chosen under camera verge3d options in Blender. Apply the puzzles for moving camera left and right to keydown/up events for moving forward and backward, but change the number to Z axis instead of Y axis.

    #79695
    albi
    Participant

    to be controlled gta style.

    Example

    I want to trigger multiple animations, ie Walk animation when walking and Idle animation for the rest of time.
    Unlike the example shared by kdv, I’m trying to trigger the animations when the Keys are pressed, not in the event of clicking any mesh.

    I have tried as below (PFA) but it’s not triggering the specified animation.

    What’s the right way to do this?

    • This reply was modified 1 month, 2 weeks ago by albi.
    Attachments:
    You must be logged in to view attached files.
    #79712
    c4cc
    Participant

    Remove “every frame” for your animations

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