Creating actor when bolean is true

NeiDnex

  • Posts: 6
Hello,I will go straight to the point.
I am making a 4-way roguelike game,and I have the key to open the door,but now what is my problem...when I pick up the key,I want to create small key above my character,that player who playing this game know that he have the key.How I can do that?

Luyren

  • *
  • Posts: 2281
You are setting a boolean for the player actor when it collides with the player, correct? In that part of your code, you can create your "key" actor that will follow the player, set an attribute of type "actor" to last created actor immediately after. You can also do that in an attribute event, literally an event that triggers only once "when boolean becoms true."

In an update event for your player, if "Key" actor has value and is alive, set its position to your player's position plus an offset. You just kill your "Key" actor when your boolean becomes false, using the event I mentioned.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

NeiDnex

  • Posts: 6
I am new to Stencyl,so I will do it in another way.I will make Grey Key as button,and when You pick up the key,he will change animation to Red.Thats my final solution.Thanks for the help!

« Last Edit: January 13, 2020, 05:45:20 pm by NeiDnex »

Luyren

  • *
  • Posts: 2281
See attached image.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter