Results 1 to 4 of 4

Thread: onObjectDestroy() triggering multiple times when navigating through components menu

  1. #1

    onObjectDestroy() triggering multiple times when navigating through components menu

    When navigating through the categories of the components menu, onObjectDestroy() is called multiple times, potentially messing up your script that relies on the event.

    When this bug occurs the object that is passed to the function has a GUID of nil. So you can protect your code from this bug with a simple check:

    function onObjectDestroy(obj)
        if obj.GUID() then
            # Your code here

  2. #2
    What does your onSave look like?

  3. #3
    Not using it. This occurs on any vanilla game with no other code. I've only been working in singleplayer, not sure if it happens in other modes.

    I've attached a screenshot of this happening in a singleplayer vanilla chess game with only an onObjectDestroy() function and me clicking the 'cards' category once (and the function being called 6 times as a result).
    Attached Images Attached Images

  4. #4
    Still not fixed as of todays update.

Similar Threads

  1. Replies: 2
    Last Post: 01-22-2018, 06:28 PM
  2. onCollisionEnter not triggering on multiple items?
    By Jabrwock in forum Scripting Bug Reports
    Replies: 1
    Last Post: 06-13-2017, 01:50 PM
  3. Runtime components
    By tjans in forum General Discussion
    Replies: 2
    Last Post: 06-05-2017, 07:22 AM
  4. Replies: 10
    Last Post: 10-30-2016, 05:56 AM
  5. SVG Art on Components
    By CounterFactorian in forum Suggestions
    Replies: 1
    Last Post: 10-01-2016, 09:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts