2D Animated Trajectory Line in Godot (with collisions!)

  Рет қаралды 24,499

MrElipteach

MrElipteach

Күн бұрын

Пікірлер: 66
@mrelipteach
@mrelipteach 2 жыл бұрын
I hope you like the video! Give me ideas on what you'd like to see next 👇 Checkout the sources github.com/MrEliptik/godot_experiments
@saulnores3477
@saulnores3477 2 жыл бұрын
I'd like to see a soccer game tutorial.
@toupocallen7572
@toupocallen7572 Жыл бұрын
The same video in 3D?
@generrosity
@generrosity 2 жыл бұрын
This is very cool! And I can see how this could be easily extended for 3d too. Thanks!
@mrelipteach
@mrelipteach 2 жыл бұрын
Yeah it can easily be extended to 3D! I'm glad you see how :) Don't hesitate to share if you do it.
@brunodbrito
@brunodbrito 2 жыл бұрын
thx dude! helped me a ton! i already had a trajectory predict on my game, but was sooooo bad and yours look so much cleaner.
@mrelipteach
@mrelipteach 2 жыл бұрын
Glad it was helpful!
@AndreaDoimo
@AndreaDoimo Жыл бұрын
Thank you! Was looking for animating the texture, and works in Godot 4!
@mrelipteach
@mrelipteach Жыл бұрын
Glad I could help!
@RayFlowerGames
@RayFlowerGames 4 ай бұрын
For 3D what you can do instead is record all positions in a PackedVector3Array variable on your existing object with physics, append it with your positions while simulating physics the same way, then you have the option of drawing something at those points. You could draw a ball that animates going through that array, animating it by incrementing an index every process frame when drawn. Then just show/hide the meshes or whatever as necessary
@leothelaen1970
@leothelaen1970 2 жыл бұрын
Great tutorial, thank you!
@EvaldoBratti
@EvaldoBratti 10 ай бұрын
That was very clever, thank you
@mrelipteach
@mrelipteach 10 ай бұрын
Glad you liked it!
@arandomperson12345
@arandomperson12345 5 ай бұрын
To those doing this tutorial in Godot4.2 or higher, the collision.normal reference should now be a function collision.get_normal() instead.
@time608
@time608 Жыл бұрын
Very good Tutorial Thanks a lot 😊😊😊
@mrelipteach
@mrelipteach Жыл бұрын
Glad it was helpful!
@rakimo6493
@rakimo6493 2 жыл бұрын
Fantastic, thank you!
@mrelipteach
@mrelipteach 2 жыл бұрын
Glad you liked it!
@ColorauGuiyino
@ColorauGuiyino Жыл бұрын
Very useful, thank you for sharing.
@AgriasOaks99
@AgriasOaks99 2 жыл бұрын
could you also make a tutorial about how to make the AoE of the impact? you know the red shape that indicates where the impact is going to be
@xtreme-software
@xtreme-software 2 жыл бұрын
Yes, please. That would be great.
@fonar-pro
@fonar-pro 2 ай бұрын
when you calculate the trajectory relative to a moving object and update it during movement, it is not possible to achieve an accurate view of the final trajectory. This takes into account the vector and the force of gravity relative to the predicted points. What algorithm should be used to calculate and update the trajectory of an already moving object?
@pashakurozeev5516
@pashakurozeev5516 2 жыл бұрын
Hello! Please make lessons on creating fishing in godot!
@yuzu-dev
@yuzu-dev 2 жыл бұрын
Thank you!
@isukwithnames1811
@isukwithnames1811 Жыл бұрын
Thanks for the tutorial it's super handy. My only question is How do I tweak this So I can make a startdew valley style fishing rod? My game is topdown Zelda style and not a side scroller/platformer style game
@mulberrytg
@mulberrytg 7 ай бұрын
great tutorial! Thanks! I'm interested in how I could do something similar in 3D?
@mrelipteach
@mrelipteach 7 ай бұрын
Most of it is similar in 3D apart from the line drawing. AFAIK there's no easy way to draw a line like this. You have to use instant geometry but if you draw a line, you'll be limited in terms of thickness and stuff. The solution is to draw a line composed of triangle to control the thickness. Maybe you can find an addon to help with that?
@mulberrytg
@mulberrytg 7 ай бұрын
@@mrelipteach thanks for your reply! I'll have to look into it more
@eanggawahyu
@eanggawahyu 10 ай бұрын
hi, this is very impressive ❤❤❤❤, interesting if you make a 3D tutorial, I would really like it
@braven4053
@braven4053 2 жыл бұрын
The same effect using vertex function: void vertex(){ UV.x -= TIME * speed; }
@mrelipteach
@mrelipteach 2 жыл бұрын
Thanks for giving another solution!
@mrvodkins
@mrvodkins Жыл бұрын
also this solution don't ruin gradient. Thanks!
@dupasmokagaming700
@dupasmokagaming700 11 ай бұрын
thanks buddy for the great vid! was looking for something like this for a while already. Just a question though - sorry if it's dumb I only started coding 3 weeks ago... ;D - so you put that variable 'dir' to the projectile script, but I assume it has to be updated somehow with your aiming method? like you move right or left to change the aim position (?) how it gets updated? Was looking for this project on github (link that you provided) but couldn't find it. Many thanks for the support mate! cheers
@dupasmokagaming700
@dupasmokagaming700 11 ай бұрын
just found the trajectory line project - will check it out myself ;) thanks anyway!
@darkfield1952
@darkfield1952 9 ай бұрын
@@dupasmokagaming700 where did you find it?
@dupasmokagaming700
@dupasmokagaming700 9 ай бұрын
@@darkfield1952 I think he moved it to somewhere else
@amarrok8010
@amarrok8010 10 ай бұрын
Como podria lanzar un objeto en esa direccion en ves de instanciarlo ? Intente pero en ves de lanzar simplemente lo suelta .. pero si lo instancio no tengo problema , alguna idea o manita ??😊
@mrelipteach
@mrelipteach 10 ай бұрын
You need to instance an object and give it the same direction and speed as you're using for the path calculation
@amarrok8010
@amarrok8010 10 ай бұрын
@@mrelipteach entonces Si o Si hay que instanciarlo , pero ahí es cuando tengo otro problemas y es que al instanciar el objeto , dicho objeto no tiene el script que debería tener ...
@cashpay50
@cashpay50 Жыл бұрын
I'm having problem with this, my collision shape is an arbitrary shape. Whenever trajectory is display, it is so much different from the actual things shot out.
@mrelipteach
@mrelipteach Жыл бұрын
have you used the same shape for the kinematicbody used to predict the collisions?
@-Solenya
@-Solenya Жыл бұрын
Very cool thank you! Is there a way to do this on a top down 2d game?
@mrelipteach
@mrelipteach Жыл бұрын
I don't see how that would work in a top down game as you see things only from above so you don't see the trajectory
@mrmikojo5738
@mrmikojo5738 10 ай бұрын
Add a shadow that follows along the ground in a straight line from the player and the spot where the first bounce lands. Then just don’t let it bounce around as much. It would need to stay near or along the same trajectory from the bounce to fake the top down perspective.
@TheAlison1456
@TheAlison1456 Жыл бұрын
Thanks.
@mrelipteach
@mrelipteach Жыл бұрын
You're welcome
@amarrok8010
@amarrok8010 11 ай бұрын
hola muy buen video pero no lo encuentro en el github, alguna idea ?
@mrelipteach
@mrelipteach 11 ай бұрын
This was a Godot 3.x project so it's in the 3.x branch: github.com/MrEliptik/godot_experiments/tree/3.x/2D/trajectory_line
@amarrok8010
@amarrok8010 11 ай бұрын
​@@mrelipteach seria posible en ves de instanciar el objeto ( como si fuese una bala o similar ) aplicarle impulso ? Mi idea era lanzar mi objeto siguiendo la trayectoria de la línea pero sin instanciarlo , alguna idea ?
@hungp.t.9915
@hungp.t.9915 Жыл бұрын
hmm, 3.5.2 texture doens't repeat (I cloned the git)
@mrelipteach
@mrelipteach Жыл бұрын
Make sure the texture is set to tile in the import tab and then on the line2D make sure under fill > texture mode to select Tile
@hungp.t.9915
@hungp.t.9915 Жыл бұрын
@@mrelipteach Oh I found it, dotted_line.png > Import tab > Texture > Flags > Repeat = Enabled ====== I think you mean Repeat in the import tab
@Jhonbxl
@Jhonbxl 9 ай бұрын
For those wanting to do this under Godot 4, the repeat property has been moved kzbin.info/www/bejne/mpynh4Wvfc-tm6s
@TheAlison1456
@TheAlison1456 Жыл бұрын
timestamps for your video 0:33 Projectile 1:09 Trajectory 2:20 Collision 3:34 Texture 4:26 Animation Shader 6:23 Outro copypaste then delete this comment if u can
@rafatokarczyk6904
@rafatokarczyk6904 Жыл бұрын
my trajectory line doesn't even show up... please help me
@realjames1
@realjames1 Жыл бұрын
same here, no idea why
@rafatokarczyk6904
@rafatokarczyk6904 Жыл бұрын
@@realjames1 like i watched the whole video about 5 times to find my mistake but i couldn't find it
@realjames1
@realjames1 Жыл бұрын
@@rafatokarczyk6904 found the issue, it turns out you can't run the update trajectory function outside the line2d, I had to just make a script and attach it to the line2d and it works fine
@israelsidharta
@israelsidharta Жыл бұрын
Does it work with godot4?
@mrelipteach
@mrelipteach Жыл бұрын
You'll probably have to adapt a few things as it was made for Godot 3.5 but it's very similar yes
@JasonEllingsworth
@JasonEllingsworth Жыл бұрын
oof this is not beginner friendly. Understandable that it is an intermediate thing and is quickly stated for someone more familiar with code, but I would have to try and dissect all this information down so I could understand why you are doing each thing, so I could replicate it in the future.
@TheStickofWar
@TheStickofWar 5 ай бұрын
That's the application of math in the real world for you
@alonzo_go
@alonzo_go Жыл бұрын
how do I go about doing this in godot 4? in the texture reimport part, there's no "repeat" option in godot 4 therefore it only shows the image 1 time along the line...
@mrelipteach
@mrelipteach Жыл бұрын
It's on the nodes themselves now. You'll find the same options under "texture" on your line2D
Platformer #1 - Destructible Terrain, 2D Platformer Physics
0:50
Jason Doucette
Рет қаралды 1,4 М.
The Ultimate Guide for Physics in Game Development!
1:04:41
Will Hess
Рет қаралды 144 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
10+1 MUST HAVE addons for Godot 4
11:18
MrElipteach
Рет қаралды 18 М.
I Made My First Game in Godot in 3 Weeks...
26:21
Jack Sather
Рет қаралды 467 М.
GODOT TUTORIAL: Shockwave shader for noobs
15:48
Nolkaloid
Рет қаралды 56 М.
These AMAZING 3D games are made in Godot
17:47
MrElipteach
Рет қаралды 12 М.
How to Add Interaction in Godot 4
16:48
Nagi
Рет қаралды 26 М.
I recreated Balatro's effects in Godot
8:04
MrElipteach
Рет қаралды 49 М.
BETTER 2D visuals in 7 EASY TIPS
10:38
MrEliptik
Рет қаралды 76 М.
You're missing out if you don't use these in Godot 4
10:49
MrElipteach
Рет қаралды 12 М.
I Recreated Arcane With $0
15:01
Noggi
Рет қаралды 1,4 МЛН
Using Composition to Make More Scalable Games in Godot
10:13
Firebelley Games
Рет қаралды 254 М.