Cuberite Forum
Velocity of arrows decreases too much - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Discussion (https://forum.cuberite.org/forum-5.html)
+--- Thread: Velocity of arrows decreases too much (/thread-2450.html)



Velocity of arrows decreases too much - exapro - 05-21-2016

Hello

I want to rise the frequency with that one shoots arrows with a bow (imagine a machine gun). But if I spawn arrows manually they don't behave like "normal" arrows because the velocity decreases much more. Also, how can I get the arrow-shooting animation of the arrow?

I have to following code in the HOOK_PLAYER_RIGHT_CLICK:
Code:
Pos = Player:GetThrowStartPos()
Speed = Player:GetThrowSpeed(30)
Arrow = World:CreateProjectile(Pos.x, Pos.y, Pos.z, cProjectileEntity.pkArrow, Player, nil, Speed)
return true


I am trying to solve this for hours, so thanks in advance Smile


RE: Velocity of arrows decreases too much - LogicParrot - 05-21-2016

There are known issues with velocity and knock-back. Someone will hopefully fix them eventually.


RE: Velocity of arrows decreases too much - xoft - 05-21-2016

Hello,
there shouldn't be any difference between spawning an arrow in a plugin and by the server.
Note that the server uses a speed coeff (for cPlayer:GetThrowSpeed() ) in the range of 6 (min bow force) to 60 (max bow force), so you might want to try with different speed coeffs.

I suppose you meant the arrow-shooting animation of the bow, there's currently no way to do that. Not sure if it is even supported in the protocol, I'd expect this to be completely client-side.