Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

3d walk

So I'm trying to make a 3D game. But I dont really know how you make a first person walk. I really wanna know so I can go further with my game. I already have a 3D world. Can someone please help me.

Comments

  • dave1707dave1707 Mod
    Posts: 7,612

    How is your 3D person defined. It seems like you could define several 3D objects and cycle thru which one you show to give the illusion of walking.

  • Posts: 2,020

    Like this

    https://codea.io/talk/discussion/6549/reproducing-blender-animations-in-codea-now-with-code-link-new-video

    I wrote the method up in 5 blog posts, starting here:

    http://saltpigmedia.com/blog/3D-Animation-in-Codea-pt1

    You might want to consider a game development environment that supports mesh skinning out of the box, as it does involve a lot of work

  • No @dave1707 I really made a 3D world but I want it so you can walk around. Just like walking in Minecraft.

  • dave1707dave1707 Mod
    Posts: 7,612

    @coder02 I don't play games, so I don't know what Minecraft looks like. I had to view a YouTube video. It looks like you are doing the moving instead of watching an object moving around the world. If that's the case, see this starter game I wrote where you move around 3D space trying to shoot 3D cubes that were randomly placed. You can look thru the code to see how I move around. I have comments in the code so that might help.

    https://codea.io/talk/discussion/6373/starter-game-16#latest
    
  • Yes, @dave1707 thanks, but I want it to walk and jump with controls and gravity, on a platform(world). I now have a world in 3D and the camera at a good height and position but I don't know how to move it on controls.

  • dave1707dave1707 Mod
    Posts: 7,612

    @coder02 In my example, the camera is moving in 3D space. The x and z camera values would be the forward/backward and left/right, while the y value would be the up/down. You just have to add/subtract some value to x,y,z to move around your world.

  • @dave1707 I'm gonna try it, thanks.

  • It works @dave1707 now I only have to make it so if holding button you will move forward.

  • dave1707dave1707 Mod
    edited January 2017 Posts: 7,612
    • @coder02 Glad to hear that. You could try Gravity.x, Gravity.z to control the movement depending on how you tilt the device. Tilt it forward to move forward, back to move backward, left to move left, or right to move right.

    EDIT: Made corrections above, it's Gravity, not gravity.

  • @dave1707 no I really want it to move on touch of buttons. I now have when you touch the button it moves only one step forward but I want it so I can hold the button and it keeps moving and when I'm not holding it stops moving. Maybe you can help me?

  • dave1707dave1707 Mod
    Posts: 7,612

    @coder02 In the touched function, set a variable to true when state is equal to BEGAN. In the draw function, as long as that variable is true, move. If it's false, don't move. In the touched function, set the variable to false when state is equal to ENDED.

  • edited January 2017 Posts: 7

    Thanks @dave1707 you helped me a lot. If I have more questions I ask you.

  • @coder02 hello ,you said you already had the 3D world of your game,so can you tell me how make the 3D world in game??? Please~

Sign In or Register to comment.