Hello i have a problem. As you can see in the video, the two ends of the wood thing dont parent correctly because the thing in the middle is not scaled [1,1,1]
Is there a way around this?
I thought of making Empties and Vertex Parent them to the middle part (But then the 2 dont rotate at all)
Add a empty, compound root object, parent all shapes to this.
you can use local space to the empty to spawn in the end caps.
empty = own.scene.addObject("Empty", beam, 0)
empty.localScale = [1,1,1]
beam.setParent(empty, 1,0)
# set x y z yourself
Local = empty.worldPosition + empty.worldOrientation*Vector(X, Y, Z)
endcap = own.scene.addObject("endcap", empty, 0}
endCap.worldPosition = Local
endCap.setParent(empty,1,0)
A) A broken bar is still a bar
B) The broken bar can be of any length
C) The caps of a bar should visually not be scaled
D) The caps of the bar are part of the physics representation.
I suggest following structure:
One bar as physics representation (invisible). It spans the complete dimension (incl. caps). You can change size by scaling the width.
The visual representation has three parts: The dynamically scaled middle part, and two non-scaled end caps. They are all ghosts!
When assembling the bar you create the physics bar and parent the other objects to it.
It wasn’t me who did the work. I just reported it.
Unfortunately it hasn’t been merged into normal BGE, but I’ve just created a pull request for UPBGE: https://github.com/UPBGE/blender/pull/534
But as the proper developers are working on the eevee integration, it may be a while before it gets into a release. And they may well decide it should be accepted into normal BGE rather than submitted to UPBGE. Eh, let’s see what happens.