How to create Flashlight

Hi there,

I can't find anything like this.

Basically how to make image follow player ? I have created something like flashlight ( black background with transparent hole) but I don't know how to make it follow player

Best Answer

  • MentalDonkeyGamesMentalDonkeyGames Posts: 1,276
    edited December 2015 Accepted Answer

    Create two game attributes (real). Call them playerX and playerY.

    In the character actot, create two behaviors.
    -constrain game.playerX to self position X.
    -constrain game.playerY to self position Y.

    In the flashlight actor, create two behaviors.
    -constrain self.position X to game.playerX.
    -constrain self.position Y to game.platerY.

Answers

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408

    constrain it's X and Y position to the X and Y position of the player

  • tomciomalinatomciomalina Member Posts: 19

    Do I need any attributes ? I am beginner

  • tomciomalinatomciomalina Member Posts: 19

    @NipaGames said:
    Create two game attributes (real). Call them playerX and playerY.

    In the character actot, create two behaviors.
    -constrain game.playerX to self position X.
    -constrain game.playerY to self position Y.

    In the flashlight actor, create two behaviors.
    -constrain self.position X to game.playerX.
    -constrain self.position Y to game.platerY.

    Thanks very much! It worked well :smile:

Sign In or Register to comment.