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.

DarkBASIC Professional Discussion / Third person strafe movement with Dark Physics Character Controller?

Author
Message
Omega gamer 89
16
Years of Service
User Offline
Joined: 10th Sep 2007
Location: Pittsburgh, PA
Posted: 16th Sep 2020 04:27 Edited at: 16th Sep 2020 04:28
I originally posted this in the Dark Physics/Dark AI board, but then I saw that there hadnt been ANY activity in that entire board in over three full years, so I figured it would be better to post it here where there's at least some activity every couple weeks or so. If this isnt allowed or is considered posting the same topic too much or anything, please let me know.

Title basically says it. I decided to bite the bullet and dive into learning Dark Physics, and Ive got gravity working and Ive got the character controller controlling my player avatar, but just one problem; There doesnt seem to be a way to strafe left and right. At least not one that works with a third-person camera.

Ive found ways that work with a first-person camera, such as rotating the player object left or right while keeping the camera pointed straight, and doing PHY MOVE CHARACTER CONTROLLER (objectnumber),(speed) so that the camera strafes left or right, but the actual player object has turned and walked forward, rather than strafing

But that only works for first person since you cant SEE the player character turning left or right. Im trying to do something with a third-person camera, so I need to be able to move the player left and right while the player object remains pointed forward.

Any ideas?
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 18th Sep 2020 14:11

Are there animation frames for your character to strafe?
If so, just using that animation combined with MOVE OBJECT LEFT and MOVE OBJECT RIGHT might work.
Send your parents to noisy sprite demo hell... enter the D-Zone
Omega gamer 89
16
Years of Service
User Offline
Joined: 10th Sep 2007
Location: Pittsburgh, PA
Posted: 19th Sep 2020 03:00
You cant use MOVE OBJECT LEFT or MOVE OBJECT or POSITION OBJECT or anything else like that when using a character controller in Dark Physics.

Basically, once you call "PHY MAKE CHARACTER CONTROLLER (objectnum)" the object who's number you provide is no longer affected by ANY of DBP's native movement commands. You have to use PHY MOVE CHARACTER CONTROLLER to move that object. Using MOVE OBJECT or POSITION OBJECT or any other command native to DBP just wont have any effect, because the Dark Physics character controller has taken over. The issue is that the only command Dark Physics has for moving the character controller is the equivalent of MOVE OBEJCT, in that in only moves forward and back in the direction the object is pointed. Theres no Dark Physics equivalent of MOVE OBJECT LEFT or POSITION OBJECT for the character controller.

All that being said, I DID manage to get it working. Im honestly not 100% sure WHY or HOW it works, but it works. It has to do with the PHY SET CHARACTER CONTROLLER DISPLACEMENT command, but the documentation for that command is utterly useless and I have no clue what its meant to do or how it works. I only managed to get strafing and jumping working by finding a code snippet that someone else had posted and just randomly tinkering around with it until I got it to work.

Login to post a reply

Server time is: 2024-04-25 13:42:41
Your offset time is: 2024-04-25 13:42:41