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}
Description
Details
- Legacy ID
- 2658355729
- Severity
- None
- Resolution
- Open
- Reproducibility
- Always
- Category
- Scripting
Load repro mission and follow hint instructions.
Event Timeline
Also, please have a look here: http://forums.bistudio.com/showthread.php?160330-Scripting-Discussion-%28dev-branch%29&p=2563710&viewfull=1#post2563710.
And Killzone_Kid's comments here: http://community.bistudio.com/wiki/setDir.
And ticket #7228.
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.