I made a follow up video on this where we calculate a trajectory between two points, the force and velocity needed to get from one to the other, it's similar but more geared towards something AI controlled, It's the Advanced Targeting part that you want to look out for th-cam.com/video/ZrZYEL4wvko/w-d-xo.html
YOU ARE A LIFE SAVER! I am an indie VR developer and needed to make this exact mechanic for my game. The code was super easy to adapt to VR and I can't thank you enough. I have subscribed.
There is something wrong with CalculateNewVelocity() method because *= Mathf(1f - drag * increment) cause velocity to be 0f in cases where object have drag > 1 / increment
Hey dude! Where did u place the struct component called ProjectileProperties? How did you use it? Like, did you place it inside another script or did you create a script just for that? Great video btw
Nice informative video. I happened across this while trying to look for something to help with having an enemy/npc attacking with a bow and calculating angle and power needed to get it to a destination. I'm not sure if I can reverse engineer your code to get something similar or if maybe you have some advice?
I believe that would require an entirely different set of calculations and it would probably be easier to start from scratch. I found this thread about it if that's helpful, otherwise it's not something I can answer at this time. You have given me an idea for a future video tho, thank you :) Trajectory Formula - discussions.unity.com/t/trajectory-of-a-projectile-formula-does-anyone-know-maths/15628/5
@ForlornU Thanks, I appreciate the help :) I'll look forward to that one. I just started this game dev thing (at 42, but I guess you're never too old to learn something new) so anything is useful.
@@ForlornU Im looking for the same thing. I dont think anyone found easy solution for this and many people are asking this online. No easy code to adapt, so that video would be highly appreciated!
I did get around to making that video, I hope it helps! It's the Advanced Targeting part that you want to look out for th-cam.com/video/ZrZYEL4wvko/w-d-xo.html
@@ForlornU Thanks wasn't familiar with rotating along velocity, experimented and it works fine. Was incrementally rotating along line path which was less efficient
It's not really a formula. Velocity is a direction and a speed: initialSpeed*direction, however to calculate for the objects mass i divide the speed with the mass, mass acting as a multiplier usually between 0 - 1.
I'm not sure I understand your question, which value? What reference is missing? You can contact me on either Discord or Reddit, search for user ForlornU and dm me a screenshot and/or a pastebin with code. I want to help but need more information
Good code, but bad video. I managed to understand the algorithm only after opening the source. If only the video has shown more than two lines at a single time, so that I could get the bigger picture.
Explaining function by function is optimal, if its confusing, the code and the entire project is provided and you can open it side by side to follow along :)
@@ForlornU i can get that, but it was super confusing when you didnt say what script some functions where in. Such as the struct. I did'nt realize that was its own script component until i found it in the git files.
I made a follow up video on this where we calculate a trajectory between two points, the force and velocity needed to get from one to the other, it's similar but more geared towards something AI controlled, It's the Advanced Targeting part that you want to look out for th-cam.com/video/ZrZYEL4wvko/w-d-xo.html
YOU ARE A LIFE SAVER! I am an indie VR developer and needed to make this exact mechanic for my game. The code was super easy to adapt to VR and I can't thank you enough. I have subscribed.
Happy to help! Best of luck on your project!
Short and sweet. I liked and subscribed
Best visual explanation i've ever seen. Keep up the great work💯
Thanks, will do!
Very useful tutorial! Helped me out lot.
That’s actually really cool
bro this is so underated
There is something wrong with CalculateNewVelocity() method because *= Mathf(1f - drag * increment) cause velocity to be 0f in cases where object have drag > 1 / increment
Very interesting and useful, thanks for your effort
Very good, thanks for sharing ☺
Hey dude! Where did u place the struct component called ProjectileProperties? How did you use it? Like, did you place it inside another script or did you create a script just for that? Great video btw
hii i downloaded your project it is succesffuly import in unity but when i fire balls are not going to designated area how i fix this pls tell me asap
Hello, how would you be able to add a height variable like the one in your archer video to the prediction curve in this exact setup?
Hi , Ive just come across your channel. Ive Subbed and hope to see more content !!
Appreciate the support! More content will come 👍
Nice informative video. I happened across this while trying to look for something to help with having an enemy/npc attacking with a bow and calculating angle and power needed to get it to a destination. I'm not sure if I can reverse engineer your code to get something similar or if maybe you have some advice?
I believe that would require an entirely different set of calculations and it would probably be easier to start from scratch. I found this thread about it if that's helpful, otherwise it's not something I can answer at this time. You have given me an idea for a future video tho, thank you :) Trajectory Formula - discussions.unity.com/t/trajectory-of-a-projectile-formula-does-anyone-know-maths/15628/5
@ForlornU Thanks, I appreciate the help :)
I'll look forward to that one. I just started this game dev thing (at 42, but I guess you're never too old to learn something new) so anything is useful.
@@ForlornU Im looking for the same thing. I dont think anyone found easy solution for this and many people are asking this online. No easy code to adapt, so that video would be highly appreciated!
I did get around to making that video, I hope it helps! It's the Advanced Targeting part that you want to look out for th-cam.com/video/ZrZYEL4wvko/w-d-xo.html
How would you go about, doing something like an arrow so it rotates along the path
In my other video on trajectories I have arrows rotating along their velocity, it's a simple shorts script - th-cam.com/video/ZrZYEL4wvko/w-d-xo.html
@@ForlornU Thanks wasn't familiar with rotating along velocity, experimented and it works fine. Was incrementally rotating along line path which was less efficient
@@lilbaby4PF glad to help!
good
vector 3 Velocity= Projectile.initialSpeed/projectile.mass* projectile.direction ....what formula is that ?
It's not really a formula. Velocity is a direction and a speed: initialSpeed*direction, however to calculate for the objects mass i divide the speed with the mass, mass acting as a multiplier usually between 0 - 1.
how can i change the value to z, because i try to use vector3 but its error missing reference
I'm not sure I understand your question, which value? What reference is missing? You can contact me on either Discord or Reddit, search for user ForlornU and dm me a screenshot and/or a pastebin with code. I want to help but need more information
One of those tutorials where the maker is trying to look cool instead of making a tutorial. Don't Bother
Guau!, okey, good, I going to applied it into Stride Engine. Already I applied a RayToOrigin(), the next is this.
Best of luck!
Good code, but bad video. I managed to understand the algorithm only after opening the source. If only the video has shown more than two lines at a single time, so that I could get the bigger picture.
I will keep this in mind for future videos, thank you
Would love to see this but in Godot!
man i hate tuples
Sorry about that! 😂 Seemed like a fun idea at the time
It is the worst and most complicated tutorial on earth!!!!!
you should shown the actual scripts to understand it more rather than doing like this and talking about it and confuse us. 😔👎
He literally described every line of code in detail and you still complaining
Explaining function by function is optimal, if its confusing, the code and the entire project is provided and you can open it side by side to follow along :)
@@ForlornU i can get that, but it was super confusing when you didnt say what script some functions where in. Such as the struct. I did'nt realize that was its own script component until i found it in the git files.
@@ForlornU just do it the "normal" way man, if you can add all this at the end of the video that would be great.. otherwise its a confusing video