Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 17,340 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Object that must fly with the camera #211960
06/19/08 11:18
06/19/08 11:18
Joined: Mar 2008
Posts: 104
theDust Offline OP
Member
theDust  Offline OP
Member

Joined: Mar 2008
Posts: 104
Hi, i have the problem that when i move my modell that must fly behind the camera, the modell( or the camera ) don't fit any more. They offset any time i press the move-button. Here the code:

action player()
{
while (1)
{
camera.pan -= mouse_force.x * 1.5;
camera.tilt += mouse_force.y * 1.5;
camera.x = my.x;
camera.y = my.y;
camera.z = my.z;
my.pan = camera.pan;
my.tilt = camera.tilt;
if (key_w) c_move (my, vector(15*time_step, 0, 0), nullvector, GLIDE);
if (key_s) c_move (my, vector(-15*time_step, 0, 0), nullvector, GLIDE);
wait (1);
}
}

That code is an action for the playermodell. I hope you understand the problem, when not try the code out wink

Re: Object that must fly with the camera [Re: theDust] #211970
06/19/08 12:13
06/19/08 12:13
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
I'm not sure, if I understand anything, but you could try the code like this, because in your code the camera's position is always set to the player's position after the wait, means a tick later than it should:

action player()
{
while (1)
{
if (key_w) c_move (my, vector(15*time_step, 0, 0), nullvector, GLIDE);
if (key_s) c_move (my, vector(-15*time_step, 0, 0), nullvector, GLIDE);
camera.pan -= mouse_force.x * 1.5;
camera.tilt += mouse_force.y * 1.5;
camera.x = my.x;
camera.y = my.y;
camera.z = my.z;
my.pan = camera.pan;
my.tilt = camera.tilt;
wait (1);
}
}

Re: Object that must fly with the camera [Re: Pappenheimer] #211973
06/19/08 12:21
06/19/08 12:21
Joined: Mar 2008
Posts: 104
theDust Offline OP
Member
theDust  Offline OP
Member

Joined: Mar 2008
Posts: 104
And again a easy sollution laugh Big Thx


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1