Projectile Trajectory Predictor - Unity Physics & Coding Tutorial

  Рет қаралды 36,250

ForlornU

ForlornU

Күн бұрын

Пікірлер: 46
@ForlornU
@ForlornU Жыл бұрын
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 kzbin.info/www/bejne/kKO9iniCadypodE
@johnraygames3106
@johnraygames3106 Жыл бұрын
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.
@ForlornU
@ForlornU Жыл бұрын
Happy to help! Best of luck on your project!
@henryqng
@henryqng Жыл бұрын
Short and sweet. I liked and subscribed
@jakobanzengruber8688
@jakobanzengruber8688 Жыл бұрын
Best visual explanation i've ever seen. Keep up the great work💯
@ForlornU
@ForlornU Жыл бұрын
Thanks, will do!
@simon5986
@simon5986 8 ай бұрын
Very useful tutorial! Helped me out lot.
@Notllamalord
@Notllamalord Жыл бұрын
That’s actually really cool
@TheAstrocricket
@TheAstrocricket Жыл бұрын
bro this is so underated
@spruslaks26
@spruslaks26 Жыл бұрын
Very interesting and useful, thanks for your effort
@castlecodersltd
@castlecodersltd Жыл бұрын
Very good, thanks for sharing ☺
@random_precision_software
@random_precision_software Жыл бұрын
Hi , Ive just come across your channel. Ive Subbed and hope to see more content !!
@ForlornU
@ForlornU Жыл бұрын
Appreciate the support! More content will come 👍
@akop1194
@akop1194 8 ай бұрын
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
@CodingWithUnity-k3q
@CodingWithUnity-k3q 5 ай бұрын
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?
@gwm249
@gwm249 Жыл бұрын
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?
@ForlornU
@ForlornU Жыл бұрын
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
@gwm249
@gwm249 Жыл бұрын
@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.
@kptmaci4979
@kptmaci4979 Жыл бұрын
@@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!
@ForlornU
@ForlornU Жыл бұрын
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 kzbin.info/www/bejne/kKO9iniCadypodE
@MandeepSingh-xn3vb
@MandeepSingh-xn3vb Ай бұрын
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
@tonymax7503
@tonymax7503 25 күн бұрын
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
@Unity_Tutorial_Games
@Unity_Tutorial_Games Жыл бұрын
good
@lilbaby4PF
@lilbaby4PF Жыл бұрын
How would you go about, doing something like an arrow so it rotates along the path
@ForlornU
@ForlornU Жыл бұрын
In my other video on trajectories I have arrows rotating along their velocity, it's a simple shorts script - kzbin.info/www/bejne/kKO9iniCadypodE
@lilbaby4PF
@lilbaby4PF Жыл бұрын
@@ForlornU Thanks wasn't familiar with rotating along velocity, experimented and it works fine. Was incrementally rotating along line path which was less efficient
@ForlornU
@ForlornU Жыл бұрын
@@lilbaby4PF glad to help!
@shidou2380
@shidou2380 Жыл бұрын
how can i change the value to z, because i try to use vector3 but its error missing reference
@ForlornU
@ForlornU Жыл бұрын
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
@muhammadumair-ql5sm
@muhammadumair-ql5sm Жыл бұрын
vector 3 Velocity= Projectile.initialSpeed/projectile.mass* projectile.direction ....what formula is that ?
@ForlornU
@ForlornU Жыл бұрын
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.
@joshuanyamori
@joshuanyamori 4 ай бұрын
One of those tutorials where the maker is trying to look cool instead of making a tutorial. Don't Bother
@diegohiroshiysusvideos2909
@diegohiroshiysusvideos2909 Жыл бұрын
Guau!, okey, good, I going to applied it into Stride Engine. Already I applied a RayToOrigin(), the next is this.
@ForlornU
@ForlornU Жыл бұрын
Best of luck!
@8BEATER1
@8BEATER1 4 ай бұрын
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.
@ForlornU
@ForlornU 3 ай бұрын
I will keep this in mind for future videos, thank you
@TheLazyJAK
@TheLazyJAK Жыл бұрын
Would love to see this but in Godot!
@__Rizzler__
@__Rizzler__ Жыл бұрын
man i hate tuples
@ForlornU
@ForlornU Жыл бұрын
Sorry about that! 😂 Seemed like a fun idea at the time
@mhf169
@mhf169 5 ай бұрын
It is the worst and most complicated tutorial on earth!!!!!
@LION303200
@LION303200 10 ай бұрын
you should shown the actual scripts to understand it more rather than doing like this and talking about it and confuse us. 😔👎
@defanserb
@defanserb 10 ай бұрын
He literally described every line of code in detail and you still complaining
@ForlornU
@ForlornU 9 ай бұрын
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 :)
@LykkeTil221
@LykkeTil221 7 ай бұрын
@@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.
@joshuanyamori
@joshuanyamori 4 ай бұрын
@@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
When Your Game Is Bad But Your Optimisation Is Genius
8:52
Vercidium
Рет қаралды 1,5 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 21 МЛН
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 20 МЛН
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,6 МЛН
From Beginner to Pro: Mastering Unity's Colliders
14:50
AnanDEV
Рет қаралды 10 М.
Unity Performance Tips: Draw Calls
4:24
Lofi Dev
Рет қаралды 200 М.
I Locked this AI Dog in an Escape Chamber for 1000 Years
21:29
Projectile Movement & Why is it Useful? ( Unity Engine Tutorial )
13:41
A Bit Of Game Dev
Рет қаралды 37 М.
How to make a 2D Bow and Arrow with UNITY & C#!
15:02
Blackthornprod
Рет қаралды 93 М.
Coding Adventure: Clouds
12:50
Sebastian Lague
Рет қаралды 1,2 МЛН
Unity pricing update | Don't Panic
4:25
ForlornU
Рет қаралды 3,1 М.
Projectile Trajectory Prediction in Unity
17:20
Sunny Valley Studio
Рет қаралды 10 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 752 М.