linnik 2 Posted July 15, 2018 Hi, I save vehicle position and load it when server starts. Every time it's happening, vehicle rotation changes. Vehicle turns right after every loading. Parking: After restart: Any suggestions? Share this post Link to post Share on other sites
MrPancakers 109 Posted July 15, 2018 Are you loading the vehicles 'heading' position? xyz won't set the rotation. You can get the vehicle heading through player.vehicle.heading; and when you spawn the vehicle, there's a 'heading' property. Share this post Link to post Share on other sites
linnik 2 Posted July 15, 2018 (edited) 2 часа назад, MrPancakers сказал: Are you loading the vehicles 'heading' position? xyz won't set the rotation. You can get the vehicle heading through player.vehicle.heading; and when you spawn the vehicle, there's a 'heading' property. I use vehicle.rotation. Vehicle.heading has only getter, setter doesn't work. Edited July 15, 2018 by linnik Share this post Link to post Share on other sites
linnik 2 Posted July 15, 2018 OMG. Why is it still so inaccurate? Red line how I left it before saving, red how it spawns after restart. Цитата let Vehicle = mp.vehicles.new( Model, new mp.Vector3(parseFloat(Data["position"]["x"]),parseFloat(Data["position"]["y"]),parseFloat(Data["position"]["z"])), { heading: parseFloat(Data["position"]["h"]) } ); Share this post Link to post Share on other sites
linnik 2 Posted July 15, 2018 (edited) Haha, this is ridiculous! In vehicle file I have 229.50584411621094 after spawning with this heading I've got vehicle.heading = 130.494140625 and vice versa when vehicle saved with the heading 130.494140625 it becomes 229.505859375 after restart. Edited July 15, 2018 by linnik Share this post Link to post Share on other sites
linnik 2 Posted July 15, 2018 How can it be if we have in wiki: Цитата heading: Number [-180:180] Share this post Link to post Share on other sites
linnik 2 Posted July 15, 2018 (edited) Not precise heading: Цитата Vehicle: 359.9999999999999(file) 359.9999694824219(vehicle.heading after setting) So I can say that vehicle.rotation works but both heading setter and vehicle.rotation round float in a some weird way. Edited July 15, 2018 by linnik Share this post Link to post Share on other sites