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 / Gravity and camera problems

Author
Message
hpfan273
19
Years of Service
User Offline
Joined: 19th Jan 2007
Location:
Posted: 13th May 2010 00:42
So I have this code, and I am trying to get the camera to follow the character, and it does! As long as the character doesn't jump or fall.... if the player falls, then the camera is then like, 100 feet below the character!! BAH!!
here is my code. If you would like to try it out to see what i mean, pleaze feel free to. Just get read of all of the texturing stuff.



Why do they turn against me? Especially when i need them the most?
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 13th May 2010 02:04
You can do something like.

if cposy#>posy# then dec cposy#
if cposy#<posy# then inc cposy#


cheers.

I'm not a grumpy grandpa
hpfan273
19
Years of Service
User Offline
Joined: 19th Jan 2007
Location:
Posted: 13th May 2010 03:17
that didn't work... did you run my code?

Why do they turn against me? Especially when i need them the most?
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 13th May 2010 11:01
Change...

To...


The 'set camera to follow' command is a self contained comers positioning system. The height variable is the distance on the Y axis from the Y Position. So a value of 8, is actually ypos + 8.
You were adding the world y position to it which produced incorrect results.

My signature is NOT a moderator plaything! Stop changing it!
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 13th May 2010 15:41
Quote: "that didn't work... did you run my code?"

Now I`m at home, and have run your code....I made some changes.I hope it can help.




cheers.

I'm not a grumpy grandpa
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 13th May 2010 17:03
4 added lines, to fix what removing 6 characters did! lol

My signature is NOT a moderator plaything! Stop changing it!
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 13th May 2010 19:17 Edited at: 13th May 2010 19:19
AaaagGHH!!...m getting O !!

cheers.



I'm not a grumpy grandpa
hpfan273
19
Years of Service
User Offline
Joined: 19th Jan 2007
Location:
Posted: 13th May 2010 19:47
It worked mobiius! thanks a bunch

Why do they turn against me? Especially when i need them the most?

Login to post a reply

Server time is: 2026-07-27 20:18:08
Your offset time is: 2026-07-27 20:18:08