I have a (VR) game where you can pick mushrooms that spawn in random locations. Right after the spawn, I want them to stand upright, as if they were growing on the ground. As soon as you pick them, they should behave more or less like the standard pickup cube (simulated physics, they cal fall over and roll around).
How do I “secure” them, and make them stand upright after the spawn?
First I thought I’d try to disable gravity, but that doesn’t seem to be possible (only for components? - I don’t really understand why). Then I tried attaching the shroom to the invisible spawning point, but that doesn’t seem to work either.
Thanks for your reply! I did have this thought. But: this function requires a primitive component reference, which I don’t have. Would I have to get the mesh component from my item first, and pass that one as target?
Nice one, Przemek! Thanks so much. I simply never thought more about this one because I thought it wouldn’t work with a component. But it works just fine with just getting the mesh component.
Its all about the components. An Actor is basically just a container for Components. If you query am Actor for its transform, it takes the transform from the Root-Component
I’m beginning to see the logic behind this, thank you for the hint. At first I assumed this was structured like a hierarchy, like if I take a component, only children of the component will be affected, nothing above it.