Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Making a Stepping Motion

Author
Message
Travis Gatlin
15
Years of Service
User Offline
Joined: 14th May 2009
Location: Oxford, Alabama
Posted: 21st Dec 2010 22:38
I am making an FPS and whenever i walk i just slide around instead of the desired walking motion.
I dont want an animation. i want my character to move like he is actually walking.
could i get this using a Sine or Cosine wave?
for example

or is there another method?

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
Eminent
14
Years of Service
User Offline
Joined: 15th Jul 2010
Location:
Posted: 22nd Dec 2010 01:04
You pretty much have to have an animation or have it rigged I think. What you're thinking about is certainly not gonna make his feet move.


29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 22nd Dec 2010 01:23
Quote: "whenever i walk i just slide around"


I've been suffering with this recently but then it has been snowing quite heavily these past few days

Being serious for a minute, yes, you can use sine or cosine as a starting point but you need to play around with the values to get something that looks right.

This is a pretty basic implementation of what you're thinking of:



As I said, this is pretty basic and there might be better ways of doing this but I hope it helps.
Travis Gatlin
15
Years of Service
User Offline
Joined: 14th May 2009
Location: Oxford, Alabama
Posted: 22nd Dec 2010 02:37
@ Eminent
i meant using a sine wave to make the camera to bob up and down to simulate walking in a First person point of view
@ 29 Games
that is really good, pretty much exactly what i need! will this interfere with collisions? Because im still working on collisions for my FPS

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 22nd Dec 2010 03:47
I don't know how this will effect collision. I can't imagine it will.

I've never actually used a bobbing camera in any of my games / demos and I don't use Sparky's collision and I vary rarely use the inbuilt collision commands so I'm not entirely sure.

What I would do is try out the collision without the bobbing camera (setting "bob_distance" to zero will sort this out) try out your collision code then add the bobbing back in, see what happens and come back to us if you have a problem.
Travis Gatlin
15
Years of Service
User Offline
Joined: 14th May 2009
Location: Oxford, Alabama
Posted: 22nd Dec 2010 04:29
ok, i'll try that, though collision is one of my weak suits

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 22nd Dec 2010 11:28
What I do is use a charcter that is animated. And position the camera at head limb position, so the position of the camera will be animated as well... Simulation any kind of situation, falling , idle, firing, dying.... All of it.

Login to post a reply

Server time is: 2024-09-29 00:26:12
Your offset time is: 2024-09-29 00:26:12