Gamestudio Links
Zorro Links
Newest Posts
Future of ZorroHFT
by TipmyPip. 11/16/25 13:52
COT Download with Quandl does not work
by Petra. 11/15/25 09:35
Training with the R bridge does not work
by Petra. 11/15/25 09:31
Zorro 2.70
by jcl. 11/15/25 08:43
Camera always moves upwards?
by NeoDumont. 11/14/25 16:32
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, NeoDumont, VoroneTZ), 8,450 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
tritom, sheliepaley, Blueguy, blobplayintennis, someone2
19178 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
What's the best way to trace distance to the floor?? #252368
02/17/09 22:12
02/17/09 22:12
Joined: Nov 2006
Posts: 193
England
RyuShinji Offline OP
Member
RyuShinji  Offline OP
Member

Joined: Nov 2006
Posts: 193
England
Hi
here's my version (the player keeps dropping slightly through the floor..? then jumping back up)
Quote:
trace_mode = ignore_me+ignore_passable+use_box;
result = trace(vector(my.x,my.y,my.z - my.z_offset),vector(my.x,my.y,my.z - 1000));
IF (result < 30) {
my.force2_z = -1 * result;
} ELSE {
my.force2_z -= 1 * time_step;
my.force2_z = max(-3,my.force2_z);
}
my.velocity_z += (time_step * my.force2_z) - (min(time_step*0.7,1) * my.velocity_z);
my.force_z = my.velocity_z * time_step;


How would you do this?

Re: What's the best way to trace distance to the floor?? [Re: RyuShinji] #252405
02/18/09 05:25
02/18/09 05:25
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
You should set player's z directly, depending on the value of "result". Don't use force_z, velocity_z, etc.


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