|
|
Animation problem ?
#296286
10/30/09 18:03
10/30/09 18:03
|
Joined: Oct 2009
Posts: 90
WickWoody
OP
Junior Member
|
OP
Junior Member
Joined: Oct 2009
Posts: 90
|
Hi, now I have another problem. I programming a 3rd person Adventure game, but there is a problem in "duck" animation. Animation seems successful but the player stands still in the air. Feet do not touch the ground. Will understand better with this picture: Duck: Stand: Thanks in advance.
Last edited by WickWoody; 10/30/09 18:05.
|
|
|
Re: Animation problem ?
[Re: WickWoody]
#296288
10/30/09 18:08
10/30/09 18:08
|
Joined: Oct 2007
Posts: 5,211 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
|
hmm, set bounding box of player to it's new bounds and let your gravity script pull the player down.
3333333333
|
|
|
Re: Animation problem ?
[Re: WickWoody]
#296297
10/30/09 19:23
10/30/09 19:23
|
Joined: Oct 2007
Posts: 5,211 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
|
you have to update the "ducking" bbox by code. change min_x min_y etc of your model to new size, then gravity will pull it down.
if you cant do this, set your model's feet to the z=0 in med.
3333333333
|
|
|
Re: Animation problem ?
[Re: WickWoody]
#296304
10/30/09 20:33
10/30/09 20:33
|
Joined: Oct 2009
Posts: 90
WickWoody
OP
Junior Member
|
OP
Junior Member
Joined: Oct 2009
Posts: 90
|
Argh, never mind. Can I get an example? If you want a model let me upload?
I found something at last. Want to give this code. The player comes into the floor of the half, leaving out key to the value needed to change?
vec_set(my.min_x, vector(0,0,15));
Last edited by WickWoody; 10/30/09 20:40.
|
|
|
Re: Animation problem ?
[Re: WickWoody]
#296305
10/30/09 20:35
10/30/09 20:35
|
Joined: Oct 2007
Posts: 5,211 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
|
c_setminmax sets bounds using the first frame of the model file. for a diffrent frame(like one of the ducking frames) you have to use c_updatehull(ent,frame_number); to update to bounding box regarding to that frame. Or you can set min_x,max_x manually to change the bounding box.
as a side note do not call c_updatehull every frame, call it once only when player changes stance(standing/ducking). I guess c_updatehull uses vertex positions to determine the bounds, more vertex your model has, longer the calculation gets, so performance wise you d only want to use it when it's necessary.
3333333333
|
|
|
|