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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...