Hi everyone! Iβm completely new to needle engine and this forum. I am using Needle in a personal project and want to borrow the idea with sockets and understand the basics of needle for creating a floorplan by serializables. I am currently struggling how to add a simple Cube in a grid with Typescript. I want to prevent use another toolkit in combination of - like BabylonJS.
Hope someone can help me and please feel free to inform me if I am hasty to asking questions here.
Thanks @AeistDesmos ! I got it. Is it possible to set position of my cube in a grid by something like a coordinate β2x3β?
( {x: number}x{y: number} )
Translate start from the actual position of your object (if x is 10 and you translateX(5) then x is 15)
Set use the local position of your object
If you want to use a string to place your object, then yes you need to calculate it like with split(βxβ) in js and convert your string to number
Or with {x}x{y} as you said etc
the position depend of the scale of your objects, you need to think to it too
Are you adding the cubes to this.scene or something? Because then theyβre outside the ObjectRaycaster. If you want them in the same hierarchy add them to this.gameObject
Ah yeah the script above looks like GridHelper is added to the scene instead of this.gameObject. The Scene is really the root of everything and the componets/hierarchy you load is put inside that
And the ObjectRaycaster is just the thing that the EventSystem uses to raycast instead of always raycasting the whole scene (that way you have more control by e.g. adding it to a few objects only).
Maybe that component should be added automatically to objects that have DragControls but no raycaster