CopyEntity ( entity[,parent] )
entity - Entity Handle
parent (optional) - Entity that will act as Parent to the copy.
Creates a copy of an entity and returns the handle of the newly created copy. This is a new entity instance of an existing entity's mesh! Anything you do to the original Mesh (such as RotateMesh) will effect all the copies. Other properties (such as EntityColor, Position etc.) since they are 'Entity' properties, will be individual to the copy.
If a parent entity is specified, the copied entity will be created at the parent entity's position. Otherwise, it will be created at 0,0,0.
; CopyEntity Example
; This example creates an entity and
; allows you to make copies of it.
AppTitle "CopyEntity Example"
Cam = CreateCamera()
Lit = CreateLight()
AnEntity = CreateCube() ; This is our Test Entity
While Not KeyDown(1) ; Until we press ESC
If KeyHit(57) Then
; When we hit Space, a new Entity is created
; These share the same internal mesh structure though!
; Hence although we are only Rotating the original MESH
; Linked to the original Entity, since it is a Mesh command,
; all the Entity Copies are linked to it..
NewEntity = CopyEntity(AnEntity) ; Hit Space to Copy!
; Change the Color of the Entity. Since this is an entity
; Property, it doesn't effect the other copies.
RenderWorld ; Draw the Scene
Flip ; Flip it into View
|DJWoodgate||(Posted 1+ years ago)|
| Note you can not copy terrain entities and you can not copy lights. |
|Buggy||(Posted 1+ years ago)|
| If the entity a child and you copy the parent, a copy of the child will also be made. |
|Ross C||(Posted 1+ years ago)|
| Nice to know, thanks lads. |
Blitz3D Manual ForumBlitzPlus Equivalent Command
|Link||(Posted 1+ years ago)|
| Yay, thanx |