Scaling and Collision - Am I Missing Something?

AfterBurnettAfterBurnett Member Posts: 3,474
edited November -1 in Working with GS (Mac)
Hi guys,

I'm trying to set a rule that an actor will be destroyed if it touches another but only once it hits a certain size. I then realised that the collision box itself doesn't scale but that doesn't matter too much, I can work around that. However, I've noticed that when I'm scaling an object it can no longer collide with another... am I missing something? Is collision turned off entirely when an object is scaling?

I can work around this issue by adding an invisible actor but I'd really rather not have to complicate things...

Comments

  • AfterBurnettAfterBurnett Member Posts: 3,474
    Bumpity bump bump bump.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    If you are using Interpolation to scale your actor, I think the collision area doesn't update until interpolation is complete.

    In this instance, until they address it, try using a Timer with a Change Attribute instead.

    i.e Every 0.01 seconds or whatever, increase the size the actor. That way the collision area will match.
  • AfterBurnettAfterBurnett Member Posts: 3,474
    I was just using "change size". Thanks though, I'll give that a go!
  • iPhoneDevForMeiPhoneDevForMe Member Posts: 362
    Check out my "Grow/Shrink" demo.

    It is the exact solution FireMaple suggested
  • AfterBurnettAfterBurnett Member Posts: 3,474
    Will do. Cheers!
  • PhoticsPhotics Member Posts: 4,172
    My next project... which might be better than Commove... had a problem with scaling actors and collision. To resolve this problem, I placed a quick timer around the scaling... like 0.25-0.50 seconds. While the size change wasn't as smooth, it resolved the problem. It also fit with the theme of my project.

    Also, with Photics: Fireball, I resolved this issue with particles. The main actor stays the same size, but the particles change size to create the illusion of depth.
  • ckck Member Posts: 224
    This also works:

    self.Size.Width = 5*cos(self.Time)*80%360+90)+self.sizeX

    5 = the amount the object will grow and shrink
    80 = the time cycle
    360+90 = where in the cycle the size oscillation starts (90 is the operative number)
    self.sizeX is a local variable setting the base size

    You need to set up a "change attribute" to set self.sizeX to self.Size.Width at the start

    Do the same for Y / Height
  • calvin9403calvin9403 Member Posts: 3,186
    @ck
    how do you find this thread that is 10 months old?
  • ckck Member Posts: 224
    Trying to figure out how to make things shrink and grow :-)
Sign In or Register to comment.