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.

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.

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.

@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.

@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.

  • @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?

@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.

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~