Jump to content

Vehicles rotate after restaring server


linnik

Recommended Posts

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 by linnik
Link to comment
Share on other sites

OMG. Why is it still so inaccurate? Red line how I left it before saving, red how it spawns after restart.

5d3yxf.jpg

Цитата

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"])
            }
        );

 

Link to comment
Share on other sites

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 by linnik
Link to comment
Share on other sites

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 by linnik
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...