When [unit(s) lookAt position] is used with position as an object, units don't react correctly. They turned in the first reveal position, and always turn in this old position wherever has moved the object.
Description
Description
Details
Details
- Severity
- Major
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 8 x64
- Operating System Version
- 1.98.146373
- Category
- Scripting
Steps To Reproduce
Launch a game with only your playable unit, and then execute this below code.
Turn around the unit created and try to speak with him... Repeat the sequence by changing your position around the unit.
When using action, the unit should turn to you, and when using a second time the action, unit stop to look at you. ...and repeat this both step.
Execute a second time this same code below to test the second alternative (do NOT restart the game!!!)(more description on Additional Information).
if !isNil"TEK_UNIT" then { deleteVehicle TEK_UNIT; }; TEK_ALTERNATIVE = ["BAD","GOOD"] select (!isNil"TEK_ALTERNATIVE" && {TEK_ALTERNATIVE == "BAD"}); TEK_SCRIPT = switch TEK_ALTERNATIVE do { case "BAD": {{_target lookAt _caller;}}; case "GOOD": {{_target lookAt getPos _caller;}}; }; TEK_UNIT = createGroup civilian createUnit ["C_Man_French_universal_F", player modelToWorld [0,3,0], [], 0, "NONE"]; TEK_RESET = false; hint format ["%1 SCRIPT", TEK_ALTERNATIVE]; TEK_UNIT addAction [ "Hello Tequiller", { params ["_target", "_caller"]; hint format ["%1 SCRIPT\n\nplayer distance _caller\n%2", TEK_ALTERNATIVE, player distance _caller]; if TEK_RESET then { _target lookAt objNull; } else { call TEK_SCRIPT; }; TEK_RESET = !TEK_RESET; }, nil, 9999, true, false, "", "true", 10 ];
Additional Information
First execute is with "Bad Script"
_target lookAt _caller;
Unit look at you only the first time.
Second execute launch the "Good Script"
_target lookAt getPos _caller
Unit is able to follow your progression.