I try to improve trigger_push to save direction of player movement.
Original code (triggers.qc\trigger_push_touch) looks like
I've added 1/10 of old entity velocity
but in game it kicks me up only for a half of height. My 'debug' code now looks like
And all vectors are fine:
WTF and what to do?
Original code (triggers.qc\trigger_push_touch) looks like
Code:
other.velocity = self.speed * self.movedir * 10;
Code:
other.velocity = other.velocity * 0.1 + self.speed * self.movedir * 10;
Code:
// scrama: save direction bprint("velocity "); bprint(vtos(other.velocity)); vel1 = other.velocity * 0.1; bprint(" -> "); bprint(vtos(vel1)); vel2 = self.speed * self.movedir * 10; bprint(" \n "); bprint(vtos(vel2)); other.velocity = vel1 + vel2; bprint(" \nresults "); bprint(vtos(other.velocity)); bprint("\n");
velocity '320.0 23.1 0.0' -> '32.0 2.3 0.0'
'0.0 0.0 1070'
results '32.0 2.3 1070'
'0.0 0.0 1070'
results '32.0 2.3 1070'
Comment