Author Topic: Question: How to attach a pickable heart to a custom entity?  (Read 1233 times)

froggy77

  • Full Member
  • ***
  • Posts: 137
    • View Profile
I see this method  'pickable:get_followed_entity()' exists so I guess it is possible to attach a pickable heart to a custom entity  would return together to the hero.
Perhaps with movements? But how then appoint an unnamed pickable heart created automaticcally by the engine?I can get the sprite with a table, but not the entity.

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1177
    • View Profile
Re: Question: How to attach a pickable heart to a custom entity?
« Reply #1 on: July 26, 2015, 09:39:49 pm »
pickable:get_followed_entity() only works with the hookshot and the boomerang.
You can define the on_position_changed() event on your custom entity, and call set_position on the pickable from there.

The collision callback of your custom entity is the entry point: if the custom entity collides with a pickable, then you know the pickable in your script even if it has no name.

froggy77

  • Full Member
  • ***
  • Posts: 137
    • View Profile
Re: Question: How to attach a pickable heart to a custom entity?
« Reply #2 on: July 26, 2015, 10:48:00 pm »
OK so I fetch in this sense.
Thank you!