Trajectory Line in Unity (This ain't your mothers trajectory line)

Trajectory prediction lines are everywhere in puzzle games and you even see them in action games to simulate grenade throw arcs etc.
This is a new method recently made possible with the addition of Multi-Scene Physics. We now have the ability to simulate frames into the future using the in-built physics system, taking into account the physics material of each object and even external forces like 2D force effectors... Making this significantly more powerful than your mothers trajectory line.
Scripts and assets: github.com/Matthew-J-Spencer/...
❤️ Become a Tarobro on Patreon: / tarodev
=========
🔔 SUBSCRIBE: bit.ly/3eqG1Z6
🗨️ DISCORD: / discord
✅ MORE TUTORIALS: / tarodev

Пікірлер: 156

  • @Tarodev
    @Tarodev2 жыл бұрын

    I somehow sped this entire video up and didn't even realize Sorry about that!

  • @jimwarden1121

    @jimwarden1121

    2 жыл бұрын

    😂

  • @ruhitrai6015

    @ruhitrai6015

    2 жыл бұрын

    😂

  • @ScientObject40

    @ScientObject40

    Жыл бұрын

    I knew it !

  • @ShatabdaRoy115

    @ShatabdaRoy115

    Жыл бұрын

    I usually watch tutorials at 2x-4x speed soooo meh

  • @MidnightSt

    @MidnightSt

    Жыл бұрын

    really? this was the first video i've ever seen from you, and I was actually enjoying how you go straight to the point, and how you don't waste time, and are going in a pleasant speed.

  • @GMTK
    @GMTK2 жыл бұрын

    Hey! Cool tutorial but unfortunately it's not very performant. In your sample scene, enabling the trajectory line drops the framerate from - on my computer - a solid 60fps to about 26fps, and increases the render thread by 10 times (~0.8ms to ~9.7ms). I think the problem might be using Instantiate and Destroy on every frame. To anyone watching this and wanting to implement it, you might want to consider a slightly tweaked approach!

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Yup, it certainly takes a toll. I've thought about it a little bit since this release and there are a few things to look into: *Reducing iterations. Increasing launch velocity can increase the length of the trajectory line, but may not be what you want *Object pooling (as you mentioned about the instantiation) *Reducing physics step time *Using a 'debounce' strategy where as the user is interacting only a fraction of iterations are calculated, lerping towards Max iterations as the player stops input. This is good because the first bounce is usually the most vital so they can line it up without lag and simply wait a second for the full line to be calculated. Not perfect.. Keen to hear other ideas

  • @GMTK

    @GMTK

    2 жыл бұрын

    @@Tarodev I've done a similar implementation in 2D, and instead of instantiating and destroying the ghost ball, I just set its position back to the cannon before doing the physics steps. Works nicely! Thanks again for the hard work put into the tutorial.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    @@GMTK I'll pin this thread so others can benefit from your discovery.

  • @Maxx__________

    @Maxx__________

    2 жыл бұрын

    Great video and concept! Much easier way of physics prediction than the mathy alternatives. It does come with some performance challenges, but nothing that (probably) can't be solved with a little work. Thanks for making this!!

  • @mileskilo6775

    @mileskilo6775

    2 жыл бұрын

    "Object pooling" is the key there, as you don't want to be instantiating things every frame.

  • @rammanohar6855
    @rammanohar68552 жыл бұрын

    I'm blown away that u can create another scene inside a scene.. Never used them before

  • @Nova04550

    @Nova04550

    2 жыл бұрын

    Agreed, this was the most magical part to me. The fact that he instantiated a scene that laid over the existing scene, then got ahold of the "PhysicsScene" on that and called "Simulate". 🤪 Very magical indeed.

  • @chimz8057
    @chimz8057 Жыл бұрын

    Thank you! For someone who's not good at programming, it's really helpful that you've uploaded the scripts!

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Happy to help! Keep in mind, this method can be quite CPU intensive

  • @CodemasterJamal
    @CodemasterJamal2 жыл бұрын

    You make really good videos. I love the production and work on your videos.

  • @alaslipknot
    @alaslipknot2 жыл бұрын

    this is easily becoming one of my favorite gamedev channel of all time, i really love your teaching style man. btw, mot sure if you're familiar with it, but Compute Shader (not just "shaders") is one of the rarest topic out there for unity, if you can get into it, that would be a blast!

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    I've watched Sebastian using compute shaders and it looks amazing! I do plan to venture in at some stage. I'm glad you're enjoying the content

  • @renman3000
    @renman30002 жыл бұрын

    Thanks so much!!! I was literally dreading having to create a Trajectory Prediction method today, until this!!! GENIUS!!

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Just be aware, it can be quite expensive. Try to keep iterations as low as possible and you should be fine

  • @user-pd6gg5ql6k
    @user-pd6gg5ql6k Жыл бұрын

    Excellent tutorial! Thanks for sharing

  • @raoulbest5395
    @raoulbest53952 жыл бұрын

    Very clean approach and thanks for the tip it's very usefull

  • @JasonMorelandDigitalrecline
    @JasonMorelandDigitalrecline2 жыл бұрын

    Excellent tutorial again.

  • @mccvargues7792
    @mccvargues7792 Жыл бұрын

    thanks! this is exactly what I need for client-side prediction for my plane sim

  • @keremyokuva5185
    @keremyokuva51852 жыл бұрын

    I love how you think about something and come back :D

  • @meowsqueak
    @meowsqueak2 жыл бұрын

    Great video. I think these kinds of videos would be even better if you have a brief high-level overview at the start to give context to *why* you’re doing things like creating a dynamic physics scene.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    You're right. Hopefully as you continued watching it became apparent? But yeah, I shouldn't make it seem like a mystery.

  • @brianpurdy2966
    @brianpurdy29662 жыл бұрын

    Love that, I have done simulations of this where it would lag the level but this was something I only recently tried. Thanks for the great content as always sir.

  • @w0mblemania
    @w0mblemania Жыл бұрын

    This is incredible. Cheers.

  • @nauvalgame7581
    @nauvalgame75812 жыл бұрын

    I hope this channel uploads more game development tutorial videos like brackeys, because I really like your previous tutorial videos.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    More coming, stay tuned 😊

  • @lauramurinova6770
    @lauramurinova67702 ай бұрын

    Thanks, great tutorial. Really saved me! :)

  • @noobcraft5712
    @noobcraft57122 жыл бұрын

    Another great totorial

  • @hieptranngoc2584
    @hieptranngoc2584 Жыл бұрын

    wow nice tut man :3 thanks

  • @UnofficialCyane
    @UnofficialCyane12 күн бұрын

    So easy and helpful. Thanks!

  • @castlecodersltd
    @castlecodersltd7 ай бұрын

    Great, helpful video, thanks ☺

  • @bedtimestories1065
    @bedtimestories10652 жыл бұрын

    That is very clever. I just wrote a script to calculate trajectory lines for a 2D game using circle casts and vector math. It works fantastically and I'm glad to have done it, but I think I'm going to switch to this method. Never thought of using scenes like this, especially for manually controlling physics steps. Thanks a ton :)

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Just a word of warning: your method will be insanely more performant. This method is calculating n physics frame every frame, so it can be very heavy. Download the package I provided, plop it into the scene and experiment before swapping over

  • @bedtimestories1065

    @bedtimestories1065

    2 жыл бұрын

    @@Tarodev Ah okay, was thinking about that. Appreciate the heads up.

  • @flammychanvtuber

    @flammychanvtuber

    11 ай бұрын

    can you help me with that script that you wrote? i'm trying to do the same but it doesn´t work

  • @TrentSterling
    @TrentSterling Жыл бұрын

    So this question comes up a lot in gamedev! I've linked this tut in various discords each time the question appears.

  • @notagamedev5494
    @notagamedev54942 жыл бұрын

    Very informative video thank you.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    😊

  • @mitchelstanley5841
    @mitchelstanley58412 жыл бұрын

    Another great video from you. Thanks. Keep up the fantastic work. Would using jobs and burst compliler mitigate the performance issues?

  • @oivoodoo
    @oivoodoo2 жыл бұрын

    Hi @Tarodev. What are you using for the 3d models in your examples? is it specific shaders? or preset that you imported from the unity assets store? thanks

  • @shirosurfer8864
    @shirosurfer88642 жыл бұрын

    Oh very nice tutorial I can see myself using this and improving it as I go Btw that materials shaders so Cool do you have tutorial on those? Very pretty colors wow

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Not yet, but I plan on making a video soon on my scene setups!

  • @emptytrunk6839
    @emptytrunk68392 жыл бұрын

    you deserve 1M Subs

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    That's a lot of subs 😛

  • @bintangfathurrahman3419
    @bintangfathurrahman3419 Жыл бұрын

    I know this is kinda stupid, but I can't help but laugh every time you mention "BALLS"

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Oh baby

  • @uregirlvipere
    @uregirlvipere Жыл бұрын

    Great video! However, here's few things I'd change: For the end tip, instead of updating the object's position every single frame, for every items in the dictionary (which is goddamn expensive and is not a good habit to have if you're planning to release a game that's not essentially destinated to high end pcs), I'd have a threshold variable that's representing how much of a difference of position and rotation requires a change. Then I'd check if the position of the ghost object is approximatively the same as the position of the real object. If not, then change it's position. Like that, you would avoid having useless calls in the update method, which is a method you should really be careful with. Also, like for the previous advice, trajectory predictions like you've shown in your video is great and always 100% accurate. However, it also is very very performance heavy, and runs at less than 60 FPS on a middle-end laptop. Something I would change to increase performances would be to actually check any changes of position or rotation in the scene, regarding the concerned objects (the canon and the ghost obstacles), and only calculate a new trajectory if the objects have changed.

  • @dandandan01
    @dandandan012 жыл бұрын

    0:32, do you mind making your way into my brain? That shook me 😂

  • @medalimakhlouf1508
    @medalimakhlouf15082 жыл бұрын

    Thx bro so much

  • @esnevip
    @esnevip2 жыл бұрын

    Might I ask how you had it define the field for you with whatever keybind you hit twice?

  • @hypertectonics7009
    @hypertectonics70092 жыл бұрын

    Interesting technique, I didn't know you could do physics scenes! It would be nice to also get rid of the renderers and other components of all the objects instead of disabling them, as they are just worthless information in the memory. The example you use is simple, but on complicated gameobjects it might make more sense to create a blank gameobject as ghost and copy to it only the relevant physics components instead of instantiating a clone. This would also save you from having to modify all your code with ghost checks and have it coupled with the trajectories system. Another thing is that keeping track of only the static objects would cause problems if you later did other modifications to the objects such as changing the physics materials on a static object.

  • @omar92
    @omar924 ай бұрын

    i think you can create a physics tag (ghost) which only affect (obstacles) so by doing that you dont need to create another scene -- i just thought of that idea after your video i was doing it mathmatically before -- so thanks soo much for the smart idea

  • @demonking2526
    @demonking25262 жыл бұрын

    Awesome video! What would mamas trajectory be like tho?

  • @carny666
    @carny6662 жыл бұрын

    GREAT!!

  • @KushagraPratap
    @KushagraPratap Жыл бұрын

    3:57 "... and this will take in my ball"

  • @zekiozdemir420
    @zekiozdemir4202 жыл бұрын

    thank you

  • @mrslake7096
    @mrslake70962 жыл бұрын

    Thanks

  • @andresadarve6419
    @andresadarve64192 жыл бұрын

    Hello! i implemented this in my project, but i dont get why it isnt working, seems like the problem is when i apply the force to my object, because the position remain the same, even if in the main scene it moves correctly. I dont know if thats becase i made the same but for 2D physics.

  • @dominikdude7065
    @dominikdude7065 Жыл бұрын

    Thank you for tNice tutorials, tNice tutorials was a huge help.

  • @rathodketan5551
    @rathodketan55512 жыл бұрын

    awsome tutorial sir

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Thanks pal

  • @rathodketan5551

    @rathodketan5551

    2 жыл бұрын

    @@Tarodev i am working on 2d scene if stuck could you please help ? ☺️

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    @@rathodketan5551 what's the problem?

  • @rathodketan5551

    @rathodketan5551

    2 жыл бұрын

    @@Tarodev in 2d scene line renderer not showing 😞😓

  • @FindTheFun
    @FindTheFun2 жыл бұрын

    You know you found the right tutorial when it has way less views than it should and gets right to the point about exactly what you want. Everyone sleeps on the best tuts.

  • @SoyelAlejandro33
    @SoyelAlejandro332 жыл бұрын

    Hi! thanks for the tutorial. I'm just getting into physics scenes but i wonder why you didn't use Physics.autoSimulation = false (true)? Thanks.

  • @trainerchad8207
    @trainerchad82072 жыл бұрын

    Your tutorials are really awesome. Can u make tutorial about stack color game?

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    That sounds like it could be a good idea. I'll add it to the list 😊

  • @renman3000
    @renman30002 жыл бұрын

    Hi there I love this tutorial but when I tested under a more demanding project where I needed lots of plot points, my engine began to choke. How can I best manipulate plot spacing?

  • @dataflick
    @dataflick2 жыл бұрын

    Great! Can you please share full unity proeject please. Will help for beginners like me :)

  • @hrishikeshgarud7177
    @hrishikeshgarud71772 жыл бұрын

    thanks. but how can we iterate through Transform ? on line 23 in foreach loop we need array or list. How it is possible?

  • @youtuber9991
    @youtuber9991 Жыл бұрын

    Another great video, thanks! I'm wondering: Any way to draw the line until it collides with a surface? Or to say until it collides up to a fixed amount, like 2-3 times? (Instead of X number of frames)

  • @victorloef

    @victorloef

    Жыл бұрын

    Since the physics are calculated, I can only imagine that collision events are enabled as well, so if the ghost ball has an onCollision method, that just adds to an int whenever it collides with something, that the for loop that adds positions to the line renderer can use, you can just break the loop whenever that number is 1. That does depend on how the onCollision method works in the simulated physics scene though.

  • @Hazzel31337
    @Hazzel31337 Жыл бұрын

    my question would be isnt it more heavy to create a second scene just for simulation instead of using math for bigger scenes ? assuming you dont need the bounces ? the speed up isnt an issue still good to follow tutorial 10/10

  • @notDiru
    @notDiru2 жыл бұрын

    So the 2nd scene is time traveling to see what's going to happen :o

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    That's a good way to put it. Pretty cool 😎

  • @cjwh33
    @cjwh332 жыл бұрын

    Great tutorial - is there any way to stretch out the prediction for a longer time without slowing down framerate? I'd be happy if I could do it at the sacrifice of line position draws but I can't seem to have any success extending the prediction before I hit framerate issues

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    I haven't tried this, but maybe double the time step each iteration? I actually don't know how it works under the hood though and chances are it's calculating every step regardless, but try that.

  • @abhinawram4014
    @abhinawram4014 Жыл бұрын

    Is there any way to make line renderer length limit ? line renderer endPos follow mouse position but line length goes infinite want line length limited.

  • @pourmydrank
    @pourmydrank Жыл бұрын

    thx

  • @panickal
    @panickal Жыл бұрын

    Any accurate way to use less iterations that cover a longer timespan, for efficiency? Maybe not because the gravity in my scene changes depending on position. Edit: I ended up using a maths method

  • @winner5743
    @winner5743 Жыл бұрын

    Great basis for a trajectory line. However as other commenters have mentioned, it's not the most optimized thing. So to improve it I put the ball back to the start position instead of deleting it (this greatly decreases the chance for ram to have small gaps). I also only call the simulate when the barrel has moved since there is no reason to simulate the same trajectory every frame if it hasn't changed. If others are interested then I will provide the code. Otherwise great video it taught me a lot.

  • @HWinsenGames

    @HWinsenGames

    Жыл бұрын

    Hi! I'm interested in the code. I want to know how others are doing it since object pooling is not helping. I'll be grateful if you would kindly provide the code!

  • @indigodoyle

    @indigodoyle

    Жыл бұрын

    would be interested in seeing the code as well

  • @mrcyruscrap

    @mrcyruscrap

    2 күн бұрын

    Could you share your code? It's very interesting to see your solution.

  • @winner5743

    @winner5743

    2 күн бұрын

    @@mrcyruscrap This is so long ago lmao. I don't have the source code anymore unfortunately.

  • @uiteh7036
    @uiteh7036 Жыл бұрын

    can you make the trajection stop at the first collision? i've been trying to do that but i can't seem to figure out how.

  • @panickal

    @panickal

    Жыл бұрын

    if (Physics.OverlapSphere(ghostObj.transform.position, 2, LayerMask.NameToLayer("Body")).Length > 0) { lineRenderer.positionCount = i; break; } I use this, it uses a layermask for the layer collision. I think it works Edit: It's placed in the for loop for the physics iterations

  • @spectralspace8866
    @spectralspace88666 ай бұрын

    I love it thank you!! But I am more impressed than my mothers slipper trajectory

  • @Tarodev

    @Tarodev

    6 ай бұрын

    They're like snipers with those things

  • @spectralspace8866

    @spectralspace8866

    6 ай бұрын

    @@Tarodev 💯🤣

  • @petsiskonstantinos1347
    @petsiskonstantinos1347 Жыл бұрын

    WHAT IS THE LINE MAT? also my line is too small. what should i increase?

  • @davitsedrakyan
    @davitsedrakyan2 жыл бұрын

    this is awesome, but is there any way to optimize it for mobile?

  • @TheNando5005
    @TheNando5005 Жыл бұрын

    in mine the line doesn't appears, what can i do?

  • @kingbling7571
    @kingbling75712 жыл бұрын

    You created a new scene, so the physics can only be calculated for objects that are part of the scene? What if, instead you used the defaultScene's PhysicsScene, it would still work but it wouldn't be efficient? Also it would move the real objects with Rigidbody which we don't want I guess?

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    That's pretty much it, yeah. We could do it on this example if it wasn't for the breakable boxes which I didn't include in the simulation scene. You'd have a phantom ball smashing the boxes the moment the trajectory line hits them :P

  • @tailwindmechanics7454
    @tailwindmechanics74542 жыл бұрын

    The playback speed of this video is a bit disturbing, I don't think it's necesary to speed it up in post as we can set the playback speed on youtube if we need to

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    This was a silly mistake and I hate it :( I must have somehow sped the entire thing up when it was only meant for a single component. Didn't even notice until somebody else pointed it out a few months back

  • @tailwindmechanics7454

    @tailwindmechanics7454

    2 жыл бұрын

    @@Tarodev ah fair enough, I just set the playback speed to .75 which did the job. Just found your channel yesterday, awesome content, appreciate the work you're putting into it!

  • @ThisOldBlog
    @ThisOldBlog2 жыл бұрын

    Hello, I recently tried out something similar and would urge anyone with complex scenes to instead duplicate the OBJECT that moves instead of the whole SCENE, and then manually call FixedUpdate() on that cloned object the hundreds of times you need. More complicated than it sounds and not a one-size fits all projects solution but hope this comment helps someone. Personally I came here for the line shader 😃

  • @AM-vr4qy

    @AM-vr4qy

    2 жыл бұрын

    How would you do that? Do you have more of an example?

  • @mehmet98
    @mehmet98 Жыл бұрын

    Whats the point of using _ before variable names ? Thanks for tutorial

  • @youtuber9991

    @youtuber9991

    Жыл бұрын

    It's just by naming convention and used to indicate that it's an instance variable of the class. It's not needed, and I personally don't use them as I'm used to Java conventions.

  • @placebo_yue
    @placebo_yue2 жыл бұрын

    Isn't this duplicate scene a memory hog? this scene is simple so it's cool, but what if i have an enormous terrain, or some complex colliders, some object with a gorillion tris, or whatever? is it viable?

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    It's not so much the double colliders, but the huge amount of physics steps being calculated every frame. You can perform trajectory calculations using simple math, but it doesn't take into account physics materials or effectors. It can also get complex if you want to simulate the bounces... So really it's a pros and cons kind of deal. But this technique is by no means performant. Cool though 😎

  • @user-yy1fm3hq5h
    @user-yy1fm3hq5h Жыл бұрын

    if i want to spawn only 3 balls and then stop??

  • @KushagraPratap
    @KushagraPratap Жыл бұрын

    Or, you could update the position only right before the trajectory is to be simulated, I like to keep Update() as a last resort

  • @panickal
    @panickal Жыл бұрын

    Works well but very intensive so I can't run it every frame (I have a solar system and apply real time acceleration every frame. So simulating several seconds of that every frame is a lot) I guess I'll have a button you press manually to run the simulation

  • @LeviAckerman-xt7dx
    @LeviAckerman-xt7dx2 жыл бұрын

    It's too high level for me. It's mind boggling how someone can come up with all of these solutions from the scratch I can barely follow the tutorial. I bet I wouldn't be able to come up a solution by my self from the scratch even after 20 years lol. I got spoiled by papa Brackeys simple tutorials so much

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Don't say that brother. In 20 years you'll be making your own game engine ;)

  • @Tropicaya

    @Tropicaya

    Жыл бұрын

    For some people things like code, math, physics, is like nerd-p0rn. Different strokes for different folks, I guess. I wouldn't sweat it. I suck at design. So maybe you're better at other things like design, or writing, etc. Good luck

  • @moldman5694

    @moldman5694

    Жыл бұрын

    @@Tropicaya Very true, I've been learning the coding part of game dev for a better part of a year and it's definitely my favorite part, but I still have no idea how to make a game "fun" 😭

  • @__JJ_
    @__JJ_ Жыл бұрын

    1:10 Is there a shortcut to make global variables autocomplete? I wonder!

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Alt + Enter. If it doesn't work it's probably a ReSharper feature. Rider also has it built in

  • @jimwarden1121
    @jimwarden11212 жыл бұрын

    the scripts and assets link is broken. plz fix it I can't download :(

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    I updated it with a direct github link

  • @mrcyruscrap
    @mrcyruscrap11 ай бұрын

    The velocity of my spawned objects does not change :(

  • @makra42069
    @makra420692 жыл бұрын

    Lmao that caption

  • @prakerindiaz6907
    @prakerindiaz69072 жыл бұрын

    bro can u make tutorial turn base game in unity ?

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    I 'kind' of cover that in my grid series (in part 2): kzread.info/dash/bejne/nZ91zNKKcbCTmqg.html

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    But maybe I could do a more in depth one to cover all the bases...

  • @ZeHalf
    @ZeHalf2 жыл бұрын

    Why did you speed up this video?)

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    This was a DUMB editing mistake. I noticed after uploading it... It was only meant to speed up one section, so don't ask me how I managed it.

  • @mikhailnikolaev9927
    @mikhailnikolaev99272 жыл бұрын

    Can't we just shoot something invisible with same characteristics and get it's route?

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    This technique predicts the future. But yes, if your scene doesn't change that should be fine.

  • @misutica7575
    @misutica7575 Жыл бұрын

    I want to start making soft as a hobby , but everytNice tutorialng is so overwhelming and I still feel lost when attempting to make soft.

  • @__Rizzler__
    @__Rizzler__10 ай бұрын

    lmao "this aint your mothers trajectory line"

  • @ani-gamer320
    @ani-gamer320 Жыл бұрын

    Anyone knows how to destroy created scene gameobject? Please help 🙂

  • @amgames5638
    @amgames5638 Жыл бұрын

    This seems very inefficient, I guess it's kinda... a fun art project. I wouldn't put this in my game even if i needed to calculate bounces(I don't really lol), I'd just take the effort to do the super complex math. It's not worth essentially doubling your game's physics load for a trajectory line lol

  • @Tarodev

    @Tarodev

    Жыл бұрын

    100%. Although, if you're able to use it lightly in a game which has no other load, it should be fine. Absolutely smashes your system though :D Besides projection, this video introduces you to the concept of multiple physics scenes. How handy is that? No idea

  • @amgames5638

    @amgames5638

    Жыл бұрын

    @@Tarodev lol, nice. I suppose it'd be fine for a game where each scene doesn't have too much content. But since becoming a programmer, I've become super picky with optimization lol

  • @Tarodev

    @Tarodev

    Жыл бұрын

    @@amgames5638 that's a good way to be. Just don't let it get in the way of actually finishing projects 😉

  • @ShinichiKudoQatnip
    @ShinichiKudoQatnip2 жыл бұрын

    My foreach is not copying the children. What am I doing wrong? Edit : Nevermind, I assigned the wrong object 🤦‍♂️

  • @random_precision_software
    @random_precision_software2 жыл бұрын

    Why do you make things complicated?..Why use create scene and put objects in.?

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    If you can show me a simpler way to handle a full physics simulation (including physics materials of each object), I'd love to see it! Always keen to learn.

  • @funy0n583
    @funy0n5832 ай бұрын

    Could you not just do this with some simple math and some logic getting the normal of the surface that each arc hits?

  • @user-mp3vi2qw3s
    @user-mp3vi2qw3s2 жыл бұрын

    안아줘요

  • @datablob
    @datablob2 жыл бұрын

    this looks like a super fun mechanic to play with! now I want to go off and make a wacky mini golf game.. 🏌️