Announcement

Collapse
No announcement yet.

How to remove object from Scene?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to remove object from Scene?

    Hi,
    does smbdy knows, how to do this? I need when i touch a object(extends PickupFactory). I want object to delete itself in
    PHP Code:
    event TouchActor OtherPrimitiveComponent OtherCompvector HitLocationvector HitNormal )
    {
        
    // delete self

    sry, for noob question.

    #2
    Other.Destroy(), or something like that.

    Comment


      #3
      Originally posted by ambershee View Post
      Other.Destroy(), or something like that.
      I have tried it, but it does not work.

      PHP Code:
      class Coin extends PickupFactory;
      ...
      event touched()
      {
          `
      log("COIN IS TOUCHED");
          Destroy();

      I see output "COIN IS TOUCHED", but Object will not be deleted(((

      Comment


        #4
        What else is in the logs? If the object is something like bNoDelete or bStatic, you might not be able to destroy it (but you can set those to false in default properties).

        Comment


          #5
          does a self.Destroy() work anyway? sounds a bit strange to me

          Comment


            #6
            Originally posted by ambershee View Post
            What else is in the logs? If the object is something like bNoDelete or bStatic, you might not be able to destroy it (but you can set those to false in default properties).
            thnx, it was that, bNoDelete. Have no idea why it was set by default.

            Originally posted by BlackHornet80 View Post
            does a self.Destroy() work anyway? sounds a bit strange to me
            nope, self.Destroy() works without Probleme. Or you mean why event touched() works? Its only because be collision is only Pawn.Touch(...) called, not Coin.Touched(...). I dunno why.

            Comment


              #7
              What I'm making, is basically setting my mesh to be hidden, and turning off any colisions with it. It works the same as destroying it ;] If you don't know how to do it, then I can show you piece of code.

              Comment


                #8
                It's not the same thing. If you hide an object and turn off collision, it still exists and will still be in memory (and still also require some processing time each tick). If you keep spawning objects, and keep hiding them, this will rapidly add up.

                In many cases, destroying it is a better option.

                Comment

                Working...
                X