Making an actor touchable then not touchable.

JaystaJaysta Member Posts: 18
edited September 2012 in Working with GS (Mac)
Hi guys,

got another problem! I have an actor I can drag on the screen to kill an enemy, but after dropping it on the screen I dont want it to be touchable (touch-pressed). I want it to stay where it has be placed.

Cant figure this trick out? Any ideas?

Thanks.

Comments

  • carlblanchetcarlblanchet Member Posts: 755
    Make a boolean attribute. Make the attribute to true. If attribute is true, when touch is pressed, do the mouse constraint. When touch is released on the actor, change attribute to false.

    That should do it.
  • Mr HansonMr Hanson Member Posts: 94
    Hello @Jaysta

    My suggestion would be to make a boolean attribute call self.Can move and set it to true.

    Then create a rule which says when touch is pressed and attribute self.can move is true then move to where ever.

    Then create a rule where if touch is released then

    change self.can move to false.

    Thats should work.

    All the best
    JonApp
  • JaystaJaysta Member Posts: 18
    Thanks guys did the trick, I can place it where I like.

    But now I can not move around the scene, I have it so when you select and item to drag on the scene it controls to camera so you can place it where you want. Do you know what else I would need to add to fix this?

    Cheers.
  • carlblanchetcarlblanchet Member Posts: 755
    Is this actor the only actor that can control the camera on your scene? Are you saying you want to be able to pick it up again after it placed?
  • JaystaJaysta Member Posts: 18
    I have a rule for the cam so when user touches/slide screen it moves around the scene, and there will be rules for actors that the user can place anywhere on screen (so the actor would need to control the cam so the user can place anywhere around the scene. (960x640)

    This actor (like others I want to create) are the users options to place on the scene to fight certain enemies, so they can place where they like and then they cannot move (like command and conquer).

    Moving the item now works good, I can move and place anywhere on scene, then it cannot be moved, but now user cannot move around the scene.

    Hope that helps!

    Thanks.
  • carlblanchetcarlblanchet Member Posts: 755
    edited September 2012
    In this case make it a self attribute as @Jaysta said. This way you won't have to make a game attribute for each actor.

    Try having the attribute change back to true lets say 0.3 seconds after the actor is released, that way the behaviour should technically restarts and you can pick the actor up and move it again.
  • JaystaJaysta Member Posts: 18
    yep thats what I did made it a self attribute. That actor works perfect as I dont want the user to move it again.

    Just the cam that controls the screen movement around the scene now does not work.

  • JaystaJaysta Member Posts: 18
    I think I need to somehow give camera controls back to the main cam that controls touch/slide around the scene, because its like the actor takes away camera control.
  • carlblanchetcarlblanchet Member Posts: 755
    edited September 2012
    try making the control camera behaviour in the actor work only if self.canMove is true.
  • Mr HansonMr Hanson Member Posts: 94
    @Jaysta

    The canera control when placed in the rule can move is true will work so you can move your actor to the edge of the screen and the camera will start to move. You can change the camera tracking area if you want it closer to the actor when the camera starts to move. Once placed it no longed has camera control so you might need to activate the camera control so they player can freely move around. Hopefully that made sense and is what you are looking for because there are two different topics happening at once.

    All the best

    JonApp
  • JaystaJaysta Member Posts: 18
    Thanks guys I will keep testing.
  • JaystaJaysta Member Posts: 18
    Still cant figure this out!

    May have to submit to support for some extra help on this one.
  • carlblanchetcarlblanchet Member Posts: 755
    I recommend you going to one of the gamesalad veterans with this question.
Sign In or Register to comment.