I got a problem and I nothing really seems to work.
My unit doesn't have a normal attack with a missle but a lightning strike comes up from the sky. This lightning strike is a dummy unit with locust, flying, no movement, no collision, no attack and the doodad- lightning strike model.
My problem: The dummy isn't created on the same position but a little distance offset. Only sometimes it looks correctly (but the debug msg still shows up)
The creation looks like this:
This is all I could think of to really make it go to the position it is supposed to go. The problem isn't that the target is moving , I wouldn't care about this small distance. The target has normal collision, but this shouldn't be the problem, as locust units should be able to be everywhere...
Any ideas?
My unit doesn't have a normal attack with a missle but a lightning strike comes up from the sky. This lightning strike is a dummy unit with locust, flying, no movement, no collision, no attack and the doodad- lightning strike model.
My problem: The dummy isn't created on the same position but a little distance offset. Only sometimes it looks correctly (but the debug msg still shows up)
The creation looks like this:
JASS:
set dummy=CreateUnit(ThePlayer,LIGHTNING_STRIKE_DUMMY_ID,0.,0.,0.)
call SetUnitPathing(dummy,false)
call SetUnitX(dummy,GetUnitX(trig))
call SetUnitY(dummy,GetUnitY(trig))
call UnitApplyTimedLife(dummy,039;BTLF039;,1.)
set dummy=null
if GetUnitX(trig) != GetUnitX(dummy) or GetUnitY(trig) != GetUnitY(dummy) then
call BJDebugMsg("wrong position")
endif //this message is displayed
This is all I could think of to really make it go to the position it is supposed to go. The problem isn't that the target is moving , I wouldn't care about this small distance. The target has normal collision, but this shouldn't be the problem, as locust units should be able to be everywhere...
Any ideas?