How to make a text that only show when the Player Character go near a specific object?

Hi, all ! Yeah, that my question. How to make a text that only show when the Player Character is nearr a specific object? Here is the example: When the Player Character approaching a door, a text show "Press (F) to open the door" or "The door is locked". Please answer this ;) . I'm really need it for my Game! Thanks

Best Answers

  • sebmacflysebmacfly Posts: 1,018
    Accepted Answer
    If your actor overlaps or collide with another, behavior display text "your text" otherwise, Display text ""
  • KevinCrossKevinCross London, UKPosts: 1,894
    Accepted Answer
    Otherwise and Else mean the same thing, although I prefer the term Else, it's more programmy.

Answers

  • sebmacflysebmacfly Member Posts: 1,018
    i think that's the best way
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    Just to back this up - a good way to do it graphically is to have an active area on the actor that is perhaps transparent and that can be your buffer. Then use the overlaps or collides.

    The other way involves maths equations to check the players x and y and rules that you have to figure out based on either the doors x and y.

    I am doing the overlaps or collides rule at the moment and using the collision shape as a circle - working a treat :)

    Totally backing up @sebmacfly - just maybe if you want a notification before the door - give the door some transparent area to trigger it.

    Cheers, M@
  • HC_DKHC_DK Member Posts: 92
    Have a look at this: http://forums.gamesalad.com/discussion/38255/within-distance
    It might give the help you need
  • LumpAppsLumpApps Member Posts: 2,881
    Or you can use magnitude. I have attached a demo (use the arrow keys left and right to make the box move towards the "door"
  • GamesITGamesIT Member Posts: 22
    If your actor overlaps or collide with another, behavior display text "your text" otherwise, Display text ""
    But there is no 'otherwise' instead of 'else' in My Gamesalad Creator. Also i'm using PC win7 64-bit
  • GamesITGamesIT Member Posts: 22
    Or you can use magnitude. I have attached a demo (use the arrow keys left and right to make the box move towards the "door"
    Thanks for the help! But i think the behavior of actor 1 and door is complicated for me. I not so understand about the behavior you give me in your, let's just say it 'Template'. Sorry if you think my English is not so good
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    Another approach would be to have a larger invisible actor constrained to your characters position. You can then trigger the text when that collides with your door, and you can make the invisible actor as big as you want.
  • GamesITGamesIT Member Posts: 22
    Just to back this up - a good way to do it graphically is to have an active area on the actor that is perhaps transparent and that can be your buffer. Then use the overlaps or collides.

    The other way involves maths equations to check the players x and y and rules that you have to figure out based on either the doors x and y.

    I am doing the overlaps or collides rule at the moment and using the collision shape as a circle - working a treat :)

    Totally backing up @sebmacfly - just maybe if you want a notification before the door - give the door some transparent area to trigger it.

    Cheers, M@
    Hi, thanks for your answer for help! For this time, i used this behavior for this time: 'Player' Collisions or overlaps with actor of type 'Door' then ' change attribute 'Show Text' to TRUE. Then create other behavior for actor that will show the text like this: Attribute, when Show Text is True, change image from Blank.png to Text.png that write "Press (F) to open the door". But my question when i used that is, How to remove the text meanwhile in PC version of Gamesalad Creator there is no "Otherwise" instead of "Else". Can you tell me more? Thanks again
  • GamesITGamesIT Member Posts: 22
    Okay, thanks for all answer you post to help me! Now I know how to make it. Thanks too for KevinCross for tell me 'else' and 'otherwise' is same. Thanks again to all who try to help me!
Sign In or Register to comment.