grebtsew / Discgolf

Discgolf game developed in Unity C#
MIT License
10 stars 5 forks source link

Hi! #2

Open Hugo768 opened 1 year ago

Hugo768 commented 1 year ago

I'm sorry to bother you, but this is not an issue. Or maybe it is. Since I cannot open your project in Unity I've been looking through your scripts. As I understand it you add all the forces in the simulation.cs script, and looking through all the forces you add. I cannot see any forces towards left or right which adds turn. Yeah, I've seen the AddTorque functions, but those are just torque. Are the able to give the disc turn or fade?

//Best regards Hugo, and thanks for replies in advance

grebtsew commented 1 year ago

Hi @Hugo768!

Do you get any error or warning when you try to open the project?

Regarding movements towards left and right. The lift force is introduced when the rotation of the disc at speed pushes air downwards, thus pushing the disc upwards. This very same force performs the movement to the left and right depending on the angle of the disc around the velocity vector. So it's the lift force that you are probably after. For example, a disc in hyzer angle will fade.

The AddTorque then determines which angle the disc will have. I tend to see it as a control system, where the throw is an impulse that, depending on disk resistance, speed and spin, goes between the phases stable, understable and overstable.

It should be mentioned that the physics in this implementation is not very accurate, rather a gamification I had to do to finish the implementation within a course deadline.

Cheers, @grebtsew

Hugo768 commented 1 year ago

When i open the project there is nothing in it. But I was most interested in the turn and fade movements since there's hard to find information about that. Maybe I'll have to try and figure out that one by myself, perhaps controlling the movement based on the angular speed. Anyways thanks for your answer.

grebtsew commented 1 year ago

Okey, do you see the folder structure when opening the project in Unity editor? Then try to locate one of the scenes and see if that loads the assets.

The mechanics of a Frisbee are quite advanced, as in addition to the throwing motion, it involves aerodynamics and gyroscopy. I can link a good reference article, which explains the physics more thoroughly, that I recommend checking out. https://morleyfielddgc.files.wordpress.com/2009/04/hummelthesis.pdf.

Otherwise, I wish you best of luck in your endeavours.

Cheers, @grebtsew