[WAD] B1777 - ScenEdit_SetUnit desiredHeading not working

Post bug reports and ask for game support here.

Moderator: MOD_Command

Post Reply
Beardy
Posts: 2
Joined: Tue Dec 24, 2024 2:14 pm

[WAD] B1777 - ScenEdit_SetUnit desiredHeading not working

Post by Beardy »

Game Version: CPE 2.4.3 B1777

Use of ScenEdit to set desired heading does not result in unit turning to heading.
Created a mission with two sides. Inserted a Typhoon FGR.4 DBID #7090

Called the following function: ScenEdit_SetUnit({name='Typhoon FGR.4', guid='X3XOJ1-0HNJ2H02M1074', heading=90}) which correctly snapped the heading to 090.
ScenEdit_SetUnit({name='Typhoon FGR.4', guid='X3XOJ1-0HNJ2H02M1074', desiredHeading=180}) but the unit doesn't turn to heading, instead it circles.
Attachments
Testing 02Feb2026.zip
(6.65 KiB) Downloaded 11 times
Kushan04
Posts: 1237
Joined: Tue Jun 28, 2005 9:27 pm
Location: USA
Contact:

Re: B1777 - ScenEdit_SetUnit desiredHeading not working

Post by Kushan04 »

It's working as intended.

desiredHeading is the direction the unit will turn to when time is running. It will not immediately snap to that heading. It's intended for ships, submarines, facilities. It won't do anything for aircraft, since as you pointed out, they will circle if they are not given a course or on a mission.

"Heading" is what you should use if you want the unit to immediately snap to a desired direction.
User avatar
blu3s
Posts: 1333
Joined: Fri Jul 08, 2022 9:45 am

Re: [WAD] B1777 - ScenEdit_SetUnit desiredHeading not working

Post by blu3s »

To add to the explanation above, desired heading in aircrafts is used for a Lua Hook that controls the intention of the aircraft, you can contact us through the Matrix Pro portal and we can send you an example
Beardy
Posts: 2
Joined: Tue Dec 24, 2024 2:14 pm

Re: B1777 - ScenEdit_SetUnit desiredHeading not working

Post by Beardy »

Kushan04 wrote: Mon Feb 02, 2026 9:36 pm It's working as intended.

desiredHeading is the direction the unit will turn to when time is running. It will not immediately snap to that heading. It's intended for ships, submarines, facilities. It won't do anything for aircraft, since as you pointed out, they will circle if they are not given a course or on a mission.

"Heading" is what you should use if you want the unit to immediately snap to a desired direction.
Apologies if it wasn't clear. The behaviour I expected was that the aircraft would turn not snap to desiredHeading. Perhaps I missed it, but I don't think the lua docs give any indication this doesn't work for aircraft.
blu3s wrote: Tue Feb 03, 2026 7:22 am To add to the explanation above, desired heading in aircrafts is used for a Lua Hook that controls the intention of the aircraft, you can contact us through the Matrix Pro portal and we can send you an example
Thanks, will do!
Post Reply

Return to “Tech Support”