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 / need help with camera collision

Author
Message
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 2nd Mar 2011 14:35
i asked this a few weeks ago but didnt really get any help.
how do u keep the camera from going into your player or wall meshes or the ground???

btw im using this code 2 circle my player :




1 last question does anyone know how i can get this code 2 revolve around my player so the camera can actually face down at the player??? currently it wont do that

tks 4 any help!
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 2nd Mar 2011 15:37 Edited at: 2nd Mar 2011 15:41
You are attempting to use mouselook to angle the camera around, yet you want it to point at the player. You can't have it both ways; either you point at the player, or you allow the user to rotate the camera based upon the mouse movements. The best I think you can do is to allow the player to rotate on the Y axis and have the camera follow from above and behind:



Use the W and S keys to move forward and backward. Use the mouse to rotate the 'player' and the camera around. Click any mouse button to quit.

David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 2nd Mar 2011 18:06
your codes cool but i like the code im using 2 rotate around my player. all i need 2 know is how do i get it 2 rotate up above my player so i can look down at them sometimes like in mw.

my game is a mw (remake) lol

also any help with collision????? anyone????????????????????????
i really need help with camera collision.



(sig 4 this post lol) id show screens of my game but im afraid some1 will copy my character. )
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 3rd Mar 2011 01:07
okay, I don't get what you are trying to do. Good luck with it.

Regarding the camera collision, why not just make a sphere (the size of the collision you want), hide it and use it for collision? You would the base the camera position upon the sphere's position (which in turn, is based upon the player's position) and would move the sphere first to see if a collision occurs.

You could use Sparky's sliding collision, checking against the other objects and it should work fine.

Login to post a reply

Server time is: 2024-11-16 19:13:32
Your offset time is: 2024-11-16 19:13:32