Jump to content

SetScale will crash LE without warning


Slastraf
 Share

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

 Share

×
×
  • Create New...