Jump to content
Slastraf

SetScale will crash LE without warning

Recommended Posts

        if self.face:GetScale().x > 0.001 then 
            local newscale = Math:Lerp(self.face:GetScale().x,0,.1)
            self.face:SetScale(Vec3(newscale,newscale,newscale))
        end

If you set the scale of a model to a value with many decimal places, LE will crash without warning. Code snippet above will crash without if case

Share this post


Link to post

What is the value that crashes it? I could see 0 causing this.

Share this post


Link to post
4 hours ago, Josh said:

What is the value that crashes it? I could see 0 causing this.

I have not exactly tested this, but if you put this in a n update function it will crash, so after it gets called often times when the value should be very low, probably 0 but it should not at exactly 0. Perhaps with a number that has too many bits from too many decimal places

Share this post


Link to post

You are very likely causing a divide by zero to occur.

Share this post


Link to post

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!

Create Your Account

Sign in

Already have an account? Sign in here.

Sign In Now
×