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 / dynamic player movement

Author
Message
MightyRy
13
Years of Service
User Offline
Joined: 19th Oct 2010
Location:
Posted: 24th Nov 2010 12:53



The problem im having is the recognition of the where the camra and player is facing, the player begins facing north, so W goes forward towards the north, S backwards to the south etc..

i move the mouse to face a different direction and i want the W to go forwards where the player is now facing!! Instead it still moves forwards to the north.

feel free to play with my code.

Any help would be great!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 24th Nov 2010 13:08
You just need to rotate the 'player' to the same Y angle as the camera as the camera is rotated:

Change this:


...to this:


MightyRy
13
Years of Service
User Offline
Joined: 19th Oct 2010
Location:
Posted: 24th Nov 2010 13:59
i have added that and it works like a dream.

you dont know how frustrating this has been.

thanks alot

one more favour



in my dbo file i have used hollow buildings (x.model) which i could walk in previously.. but i have played around with movement alot recently and since i have not been able to go in them.

Can you see why, are know of any reason why this is happening.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 24th Nov 2010 14:09
Quote: "you dont know how frustrating this has been."

Been there...

Quote: "in my dbo file i have used hollow buildings (x.model) which i could walk in previously.. but i have played around with movement alot recently and since i have not been able to go in them.

Can you see why, are know of any reason why this is happening. "

Hard to tell for sure without the media but you could try reducing the radius on your collision check (currently 30) as your sphere only has a radius of 10...

Login to post a reply

Server time is: 2024-09-29 00:28:07
Your offset time is: 2024-09-29 00:28:07