Change Actor

Hi!

How to I change actor? Like if a player find a sword. Player change to player with sword?

Comments

  • SolarPepperStudiosSolarPepperStudios Member Posts: 754
    When player overlaps or collides with sword
    spawn actor player w/ sword at player.position.x and player.position.y
    destroy actor player
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    While @Utveckla_Games' suggestion will work, it's generally better to change the image of the actor (self.Image) and just have different rules for the actor when it "has a sword." That way, you have a single actor for your player instead of a separate actor for each item you find.

    You can use a boolean for each item, such as self.hasSword (true or false) and then base your rules off of that.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SolarPepperStudiosSolarPepperStudios Member Posts: 754
    @tatiang True true my friend... I forgot about the self attributes. To add onto what you said, a suggestion I would make would be make groups and name them after each function to help "clean up" your "workspace". :)
  • T0bsomT0bsom Member Posts: 9
    Thanks for answer! :D
Sign In or Register to comment.