Snap to point?

jilliansjillians Member Posts: 33
edited November -1 in Working with GS (Mac)
I want an actor to snap it's position centered over another actor, can anyone point me in the right direction?

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi Jillian, there's a terrific snap to grid template around by Joe of FireMapleGames which is quite sophisticated.

    A not-so-sophisticated solution to your problem would be something like:

    ---let's call ActorA the stationary actor, and ActorB the dragged actor (if it's dragged...)

    Rule: ---- in the dragged actor
    When touch is released
    Interpolate self.Position.X to ActorA.Position.X
    Interpolate self.Position.Y to ActorA.Position.Y

    hope that helps

    :-)

    ----------------------------------------------
    http://davidgriffinapps.co.uk/
  • jilliansjillians Member Posts: 33
    Yea snap to grid won't work because this isn't a grid. This sounds like it will do the trick, i'll try it out!

    Thanks!
    -Jillian
  • jilliansjillians Member Posts: 33
    This does not seem to be working, the actor kinda wigs out and freezes the whole screen. Anything else i could try guys?
  • jilliansjillians Member Posts: 33
    been stuck on this a couple hours now, anyone have any suggestions?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi Jillian, sorry to hear about your problems there; but it should work fine. I'm not sure what's going on for it not to work... when you say the actor kinda wigs out, can you explain bit more what happens please?

    An alternative to Interpolate in this situation would be to use Move behavior; though I don' think you'll have as much control.

    In the meantime, hopefully someone else can think of why this isn't working properly...
  • jilliansjillians Member Posts: 33
    By wig out i mean they vibrate really fast when they touch any of these objects with interpolation active. It's like the actor can't make up it's mind where to go, so it's going back and forth.... Anyway, i put this aside for now, will approach fresh again tomorrow.

    Thanks for all your input guys! Love the ideas.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    I'm wondering if you've use touch pressed instead of touch released...
Sign In or Register to comment.