Entity CreateLink

From CryWiki

Jump to: navigation, search

entity:CreateLink(string)

Description

Creates a link between 2 entities.

Arguments

  1. Name of the link


Example

Lua (example)
-- Creates a link 'MyLink'
g_localActor:CreateLink("MyLink");
-- Sets the MyLink to a vehicle
g_localActor:SetLinkTarget("MyLink", System.GetEntityByName("US_apc1").id);
 
Log("The local actor is linked to %d entities, MyLink entity: %s", 
    g_localActor:CountLinks(), 
    g_localActor:GetLinkTarget("MyLink"):GetName()
);


Notes

CreateLink alone does not do much, you have to use it in combination with SetLinkTarget.

Personal tools