Godot Version
4.3
Question
` I am trying to make a golf game similar to the mini put game that discord offers. I want to make the pull back meter act in the same way as that game, where if you pull back you can visually see the strength meter increase; however, if you pull too far the meter begins to sway back and forth which can effect your accuracy.
I have the meter set up properly and it works like it should for tracking the mouse when the ball is selected following this tutorial 3D golf game in godot. The part that is causing me issuers right now is the swaying aspect of the meter.
If you watch the video it shows that in the ball scene tree we have a Marker3D with a meshInstance child, which we then set to a quad instance. As of right now I use the marker2D which I called scaler, to scale the mesh instance in the z direction to indicate how far back you have pulled on the ball. I used the look_at function with the parameter that’s passed in being the vector from my balls origin to the mouse location, this works as intended
When I try to rotate the 3dMeshinstance it seems to skew rather then rotate, so I tried putting it at the top level but this then messes up the origin of the mesh and no longer stays with the ball
I am trying to apply a simple sinusoid function that just makes the meter sway depending on the distance the player has pulled back on the ball. This is clamped to a range of values.
What I have tried
- I have tried creating another node in-between scaler and mesh but this causes the same problem
2, I have tried manipulating the mesh directly but again causes the skewing problem. - I globalized my coordinate transformation for the scaler node and then tried manipulating the sway node but this didn’t work (caused skew problem again)
If anyone has any ideas on how I could fix or go about setting this up let me know.`