Tour Preview

Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 1 Support › Remove Entity when it leaves the Screen

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4484

    phil.jahoda

    Hi, I have a dartarrow entity, and what I want to do is remove it when it leaves the screen.

    Therefore, I thought of using the onYChanged method.

    How can I remove “the” entity in its own onYchanged method?

     

    EntityBase {
        id: entity
        entityType: "dartarrow"
    
        onYChanged: {
            // HOW TO REMOVE AN ENTITY HERE?
        }
    
        property bool showed: false
        property int number
        property real speed: 1000.0
    
         BoxCollider {
             // some more code here...
         }
    }
    
    

     

    #4486

    phil.jahoda

    Consider this problem solved.

    You can easily remove an entity by calling id.removeEntity(); within the entity.

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.