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 Discussion / Third person camera.

Author
Message
Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 29th Oct 2005 16:17 Edited at: 29th Oct 2005 16:18
Thanks to every one who helped on this thread
http://forum.thegamecreators.com/?m=forum_view&t=63620&b=10
But I have changed my game idea to third person.
(I think I am allowed to post this if not please tell me)

Right down to buisness.
Here is my code so far.


But the thing is, is I want it so that the camera does not follow right behind the player object (which is a box right now) but will allow the player to click the left/right keys and have the player object rotate to face that direction and still with the key held walk in that direction.
And I only want the camera to move to be behind the object when the object is walking towards the camera.

Any help would be really cool

Thanks

BM

Our aim is to keep the loo's clean, your aim can help.
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 29th Oct 2005 19:53
Big Man,

So, I suppose you are saying that you wish to rotate the camera seperate from the character, but have the camera to always look at the character. You will two variables, one for the camera angle and one for the character angle.

Get rid of these lines of code.


Add this to your code right above the point camera code.


[b]Note:You will need to set the camera distance from character(camdistance#) and its height(camposy#).



+NanoBrain+
Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 29th Oct 2005 20:00
I did everything you said and it said unrecognised peramiter on this line


Our aim is to keep the loo's clean, your aim can help.
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 29th Oct 2005 20:04
Big Man,

Whoopsie. Don't you just love being a human in err. Change if inkey$(a) = 1 to if inkey$() = "a", and if inkey$(d) = 1 to if inkey$() = "d". This should fix the problem.



+NanoBrain+
Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 29th Oct 2005 20:07
I've done that and I just this minute sorted out some problems but now the camera is looking up his but crack between his legs.
Hmmm

here is the section of code


Our aim is to keep the loo's clean, your aim can help.
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 29th Oct 2005 20:29
Big Man,

You're resetting camangley to 200 every loop. Take that line out. Also, I have set camdistance# as a real value, not an integer. Therefore, change camdistance to camdistance# with a pound sign(#), or vice-versa. Lasty, neither do you need to resett camdistance# to 200 each loop. Place the resetting of camposy and camdistance# to somewhere above your main loop.



+NanoBrain+
Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 29th Oct 2005 20:47
Thank you soo much but now how would I go about having it so that I dont have to click a or d to rotate the camera and have it so when my object is heading towards/go's past the camera, The camera would flip over so that it is behind the player again.



Our aim is to keep the loo's clean, your aim can help.
Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 29th Oct 2005 21:35 Edited at: 29th Oct 2005 21:46
Don't worry.
I don't know what I did, I think it was me fiddling around with the set camera to follow command but I did it.
Thanks for all of your help.

BM

Our aim is to keep the loo's clean, your aim can help.
Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 30th Oct 2005 14:43
Hmm mabey not.

what happens now is when the player walks past the camera the camera will flip but when the player lets go of the up key the camera looks at the front of the model agian in game this could be quite bad.
here is the set camera follow comand



Our aim is to keep the loo's clean, your aim can help.
RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 30th Oct 2005 15:01 Edited at: 30th Oct 2005 15:08
http://forum.thegamecreators.com/?m=forum_view&t=63718&b=6&p=0
Great fuction for camera control, and here's a demo of what you're looking for using that function:




If that's not what you're looking for you can always change the parameters to suit your needs, I did that sample code in minutes so Im sure if you worked at it for a while you'd get the effect you want.

<EDIT>

Woops I realize that the sample code I gave you isn't what you asked for. If you describe it some more I could make it, just a little confused with what you're asking for. Either way the function should handle what you want it'll just take some time to get the params right.

Big Man
20
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 30th Oct 2005 15:10
I had a look but it won't work

Our aim is to keep the loo's clean, your aim can help.
The ARRAYinator
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location:
Posted: 1st Nov 2005 15:16
Check the Binary moon tutorials. He has a great third person camera function there!

Login to post a reply

Server time is: 2025-05-22 13:05:48
Your offset time is: 2025-05-22 13:05:48