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.

Dark GDK / Strafing with Fulcrum

Author
Message
DrRockso_X
13
Years of Service
User Offline
Joined: 26th May 2011
Location:
Posted: 26th May 2011 11:21
I'm using Fulcrum physics and I was wondering if anyone has found a way to make a character controller strafe. I know that there are built in ways for back and forth. If youve fuigered it out please explain it to me, thank you.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 27th May 2011 19:40 Edited at: 27th May 2011 22:18
As you only need to worry about two dimensions (x and z) for character movement, some simple trig should solve your problem, use this overload of the function:



Use this next piece of code to get your X, Y and Z values and put them in a dispacement vector:


If you get that working for forward movement you should just be able to add 90 to the object angle and your character will strafe.

EDIT: You could also just turn your character, move, and then turn it back, buts thats a bit of a hack

DrRockso_X
13
Years of Service
User Offline
Joined: 26th May 2011
Location:
Posted: 27th May 2011 20:01
Thanks! I'll try it out....
DrRockso_X
13
Years of Service
User Offline
Joined: 26th May 2011
Location:
Posted: 28th May 2011 17:32 Edited at: 28th May 2011 20:57
I added this to the code



But I'm not sure how you get data from what I assume is displacement vector

I've looked around a bit on the net, but I couldn't find anything to help me...
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 29th May 2011 00:10
Try this, should work:


DrRockso_X
13
Years of Service
User Offline
Joined: 26th May 2011
Location:
Posted: 29th May 2011 19:40
Thank you very much! I tried it out and it works. I'll try my best to learn more about vectors and such, but this was really jamming up the development pipeline. Thanks.

Login to post a reply

Server time is: 2024-10-02 17:29:03
Your offset time is: 2024-10-02 17:29:03