question about constraining actors

SAMmanSAMman Member Posts: 228
edited November -1 in Working with GS (Mac)
Hey guys, so I have this actor set up to constrain it's x and y to that of another actor when it collides. then I have it so that you can rotate the actor. I also have it set up that when they collide, another actor is spawned and should collide like the first one and be constrained as well. the problem is that when the second actor is spawned and collides with the original actor the first actor that collided disappears. I'm totally stumped as to why. any ideas? Thanks.
SM

Comments

  • hotMagichotMagic Member, PRO Posts: 266
    Are they supposed to constrain to the same actor? More details on that. Are they of the same prototype?
  • SAMmanSAMman Member Posts: 228
    yes, they are of the same prototype and they are supposed constrain to the same actor. picture actor 1 on the screen somewhere, actor 2 appears and move to it and then sticks to actor 1 when they collide, it also stays where it collides, then when it collides it also spawns actor 2 again to do the same thing, only it is supposed to build on top of the other actor 2, kind of like stacking blocks on top of eachother.
  • SAMmanSAMman Member Posts: 228
    I hope that makes sense.
  • hotMagichotMagic Member, PRO Posts: 266
    How are you doing the offset? Im asking because the possibility of overlap. As in, are you counting the actor2 objects and doing constrain Y +10 or something?
  • SAMmanSAMman Member Posts: 228
    yes, I am doing it like that so that they don't overlap, instead of +10, I do it plus the width of the object and multiply it by the number of objects.
  • hotMagichotMagic Member, PRO Posts: 266
    Ok so just making sure, do all the actor2s know who they are?
    Since they're the same type, you probably have to do and init thing if you're spawning them (like on self.time=). On the init, do:

    if self.timer==0 then
    {
    if actorcount==1, self.ID=1
    if actorcount==2, self.ID=2

    actorcount= actorcount+1
    }

    that time=0 gate makes it so 1 doesnt become two when two is spawned
    if you mess around with self.time, then just use a flag isIDed=0 or something.

    Sorry if that's off base but it's my first guess of what's happening.
  • SAMmanSAMman Member Posts: 228
    that makes sense to tell them they are different spawns, that is what I need to do just not sure how. I will try the self.ID thing. thanks.
  • hotMagichotMagic Member, PRO Posts: 266
    If you have a problem, then post a screenshot of that logic and ill take a peek. I deal with ID stuff on my current game a LOT.
  • SAMmanSAMman Member Posts: 228
    k, thanks, uh how do I post a screen shot?
  • SAMmanSAMman Member Posts: 228
    when I turn off the constrain attribute they don't disappear, but I need those to be on, at least I know those are the problem.
  • SAMmanSAMman Member Posts: 228
    i really cant figure this out. ugh.
  • hotMagichotMagic Member, PRO Posts: 266
    They disappear on the constrain because they are constraining to the same spot.

    That's why I told you to ID them above.
Sign In or Register to comment.