How to define different origins/sockets/reference points for a 3d Model

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By maurice

Suppose I have a 3d model of a weapon. This weapon can be collected and it has some kind of shiny sphere wobbling around it while it lays on the ground waiting to be picked up by a player.

While laying around I want that weapon to be centered in the sphere, so I need the origin of the weapon to be at the center of it’s volume. That allows me to just place it at position 0,0,0 and it is centered within the sphere

If I want to place that weapon in a players hand I optimally want that origin point to be at the handle.

As far as I know a 3d model can only have one point of origin. The Unreal engine has the concept of sockets as a solution to this.

My only idea is to make two scenes for each weapon: One in which I place the handle at position 0,0,0 and one in which I do the same with the center of volume. But this solution has the drawback that I can’t have two reference points in one scene.
I would need one for the handle and one for the point where the bullet is spawned.

What is the godot way to solve this?

:bust_in_silhouette: Reply From: holgert

Hi! Its a litte bit late, but you can do the following:

  1. Create a 2D/3D-Position on the Position of the Socket.
  2. If you want to have an hierachie put the position over the element you want to control.
  3. Calculate with the coords of that position.

For me the solutions works in a little space-station-building-project. There i put a position on the docking-points and later i only have to calculate a litte bit to put the new module on the position.