Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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 | chip programmers | 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