Craete Custom Property on Node

Hi all,

I have a question, when I create programs using babylon js, often I pass additional properties to the babylon object like “Node”, for example as below:

const house = new BABYLON.TransformNode("House",scene);
house.walls = wallMeshes // otherMeshes 

Will it affect performance ?

Hello! The rendering performance by itself won’t be affected by these kinds of extra properties, only the amount of memory used by Javascript, which happens in every program.

One thing that might be good to keep in mind is that the Node class and all of its children already have a property dedicated to store user information, metadata ( Node | Babylon.js Documentation (babylonjs.com)), which is automatically serialized if you save the scene in the .babylon format. So, if you use this format to store scenes and wants to save custom information, metadata is very useful.

2 Likes

Hi @carolhmj , I understand now thanks for the answers and suggestions :slight_smile:

1 Like