Page MenuHomeFeedback Tracker

Not possible to setDir and setVelocity on the same frame
Reviewed, WishlistPublic

Description

Executing the setDir command forces object velocity to [0,0,0] on the frame it is executed on. It is impossible for an object to change direction AND maintain or change velocity on a given frame. {F22904}

Details

Legacy ID
2658355729
Severity
None
Resolution
Open
Reproducibility
Always
Category
Scripting
Steps To Reproduce

Load repro mission and follow hint instructions.

Event Timeline

MakeLoveNotWar edited Additional Information. (Show Details)
MakeLoveNotWar set Category to Scripting.
MakeLoveNotWar set Reproducibility to Always.
MakeLoveNotWar set Severity to None.
MakeLoveNotWar set Resolution to Open.
MakeLoveNotWar set Legacy ID to 2658355729.May 7 2016, 5:35 PM

A few more notes. This is not a problem exclusize to the setDir command, as setVectorDir and setVectorDirAndUp also suffer from this issue. Although I do not have a good grasp of the setVelocityTransformation command yet, it does not appear to be a valid workaround either (I'd be delighted if somebody could demonstrate different). Also, trying to re-arrage the calling sequences of the commands - setDir before setVelocity or vice versa, for example - as well as combinations such as calling multiple times as suggested by Killzone_Kid in the attachTo ticket (#0007228) also does not work.

The title is a bit misleading. It is in fact possible to do this in the same frame, however it looks like setVelocity needs time to be applied and calling setDir on the next frame might be overwriting setVelocity set in previous frame.

It is just a theory. But if you need to move and rotate object at the same time perhaps http://resources.bisimulations.com/wiki/setVelocityTransformation command could be more suitable.

Thank you for the correction and the info, KK. As I suspected, setVelocityTransformation is probably what is needed. Also thanks for the BSim's VBS wiki link (ProGame suggested it earlier as well) as that is indeed much more informative than what's available on the Arma BIKI. Another suggestion for anyone else interested in researching this command is to look at the BIS_fnc_unitCapture nnd BIS_fnc_unitPlay code. I'll be investigating this more thoroughly and will report back on the BIF with my findings.