attach

attach

attachment

Details

Kode wheel segment Objects/Attachment
Style Specialised
Modifiers  offset / to socket
Primarily WHEN/DO DO
Pre-made brains that use it Unknown

Objects >Attachment > attach

Description

This tile allows you to attach one object to another. The object is attached to one of the sockets on the object and will move with that socket. Attached objects are not affected by all of the physical settings of the parent object. For example, if the parent object’s visible setting is set to false (so it is invisible) the attached objects are not affected, and remain visible. In this way you can create new models by attaching objects to a parent object and making it invisible. Attached objects will be destroyed if the parent object is destroyed. Attached objects that are collidable can cause a problem which throws objects into the air or across the map. To prevent this, make sure all your attached objects are non-collidable. Most of the time however, objects will be attached in edit mode where you have finer control of position and orientation.

Example Code

 

WHEN [once] DO [attach][sword][to socket][back side]

Modifiers

offset: Paired with a vector or offset position this will change the position of the object in relation to a socket. Best paired with a socket position

WHEN DO [vectorvar:swordpos][y][=][-1]

WHEN [once] DO [attach][sword][to socket][back side][offset][vectorvar:swordpos]

to socket: Paired with a socket name. This will attach an object to a specified socket, such as left hand, head

Other Uses

I use this tile for my vehicle driving kode. I attach the player to the vehicle and make them invisible and turn their brain off. The vehicle controls are then turned on and you can drive around. When the player exits the vehicle they are detached from the vehicle and brain and visibility turned on.

Comments are closed.

Website Powered by WordPress.com.

Up ↑

%d bloggers like this: