Entity DrawSlot

From CryWiki

Jump to: navigation, search

entity:DrawSlot(number, bool)

Description

Draws or hides a specified slot. This can, for example, be used to switch models easily. SetAttachmentObject.

Arguments

  1. Slot id
  2. Draw=1, Hide=0


Example

Lua (example)
-- Spawns an entity
local ent = System.SpawnEntity({class="BasicEntity",position=g_localActor:GetPos(),name="MySpecialEnt"});
-- Load 2 objects in 2 different slots
ent:LoadObject(0, "objects/Editor/dx10.cgf");
ent:LoadObject(1, "objects/box.cgf");
-- After 3 seconds (3000ms) switch the models around
Script.SetTimer(3000, function() 
  System.GetEntityByName("MySpecialEnt"):DrawSlot(0,0); -- Hide slot 0
  System.GetEntityByName("MySpecialEnt"):DrawSlot(1,1); -- Show slot 1
  Log("Changed models!");
end);


Personal tools