Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,369 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Jump only when you touching ground ! #252485
02/18/09 14:25
02/18/09 14:25
Joined: Mar 2008
Posts: 104
theDust Offline OP
Member
theDust  Offline OP
Member

Joined: Mar 2008
Posts: 104
Hihoo, i want that my player only can jump when he is touching ground, not the walls for example. Only when the lowest point of the modell touches another block or modell he can jump. How i can do this ?

Something like this would be good:

if(collision at position (x,y, z - 2/height of playermodel)
...

Re: Jump only when you touching ground ! [Re: theDust] #252488
02/18/09 14:33
02/18/09 14:33
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Do a c_trace from the player to a position under his feet, check if there is anything and maybe how far away it is, this will give you a clue about if the player touches the ground or not.

Re: Jump only when you touching ground ! [Re: theDust] #252591
02/19/09 06:15
02/19/09 06:15
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
Xarthor is right. Use vec_for_vertex to get the position of a vertex on player's feet, and then trace from there below it.

Re: Jump only when you touching ground ! [Re: George] #252635
02/19/09 11:32
02/19/09 11:32
Joined: Mar 2008
Posts: 104
theDust Offline OP
Member
theDust  Offline OP
Member

Joined: Mar 2008
Posts: 104
Interesting way to check collisions smile Thx !

Re: Jump only when you touching ground ! [Re: theDust] #252776
02/20/09 07:07
02/20/09 07:07
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
You are welcome. This is the best way of doing the things because it takes into account the actual animation frame, not just the origin of the model.


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