Jump to content

How to pass an entity to a component?


Go to solution Solved by Dreikblack,

Recommended Posts

Posted

The idea is how I implement in json the parameter to pass an entity, a light, a door, the idea is to create a component that turns lights on or off, that can open and close doors

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

  • Solution
Posted

In json

{
    "name": "target",
    "label": "Target",
    "value": null
}

In Load() for Lua it's probably something like:

if type(properties["target"]) == "string" then
  target = scene:GetEntity(properties["target"])
end

In editor drag'n'drop entity from Scene tab to component field or choose it by clicking on field

Check out Slipgate Tactics demo, which is made with Ultra Engine:

https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...