游戏精英
 
- 贡献度
- 929
- 金元
- 51235
- 积分
- 8920
- 精华
- 8
- 注册时间
- 2004-11-2
|
本帖最后由 吃鱼的人 于 2016-9-20 11:59 编辑
脚本调试了很久了,总是做不到按照准星自由转动抛射物的角度。第一人称下还有问题应该是骨骼node的问题,但第三人称下每次抛射的角度都是45度到60度左右,无法做到30度以下平射类似加农炮的射角。
Scriptname BallThrower extends activemagiceffect
MiscObject Property BallBowl auto
Event OnEffectStart(Actor Target, Actor Caster)
ObjectReference Ball = Caster.PlaceAtMe(BallBowl,1,false,true)
PokeBall.MoveToNode(Caster, "NPCEyeBone")
Ball.Enable()
while(Ball.is3DLoaded() == false)
Utility.wait(0.05)
endwhile
float anglePercent = (180 -(70 + Caster.GetAngleX()) ) / 180
float x = Math.Sin(Caster.GetAngleZ())
float y = Math.Cos(Caster.GetAngleZ())
float h = ( anglePercent * Ball.GetHeight() )
float impact = ( anglePercent * 350)
Utility.wait(0.05)
Ball.ApplyHavokImpulse(x, y, anglePercent , impact )
Ball.RegisterForSingleUpdate(3)
EndEvent
|
|