I was wondering if its somehow possible to set rotation/angular velocity of a game object using a dynamic collision object in 2d physics in the x and y axis as well as Z. Setting angular velocity or rotation manually doesn’t work, since x and y get reset to 0. I also tried transforming with a rotation matrix in the vertex shader, but since I’m guessing that vertices for a mesh component come already translated, they don’t rotate around their center. Is there a way to do this in 2d physics?
What if you compose this out of multiple game objects (ie using a collection)? You could put the collision object in one game object and then in a child game object you have the visuals which you can rotate however you want. I haven’t actually tested this but it might work.
2 Likes
Thanks! I was trying to avoid that, but guess I’ll have to.
Edit: Actually didn’t take as long to rework as I thought it would. Works great, thanks!
1 Like
This is a great approach, I tend to do this when working with 3D models and 2D physics.
2 Likes