Тёмный

Fixing Jittery Movement In Godot 

Garbaj
Подписаться 462 тыс.
Просмотров 56 тыс.
50% 1

How to fix jittery movement in Godot by using physics step interpolation.
Buy Me A Coffee: ko-fi.com/garbaj
-- Social --
Discord: The discord has been shut down, sorry!
Twitter: / garbaj2
-- Links --
Website: garbaj.net
Github: github.com/Gar...

Опубликовано:

 

14 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 189   
@Goldenfightinglink
@Goldenfightinglink 3 года назад
I like the explanations, I get a better grasp if I get the why instead of a "it's common standard"
@coderdbd
@coderdbd 3 месяца назад
I've been trying to figure it out. I'm pretty sure, different calls to physics_process overlap and one step gets resolved before the previous one. I had this problem with 2D jittering. It's NOT the answer, but if you're desperate, try adding some "processing" to the physics_process so it doesn't end so quickly. My game had that problem, again, it's NOT a solution, just a quick fix. I added these lines before calling move_and_side() and it worked: for n in range(0, 20000, 1): velocity.y = velocity.y; I hope this comment can help someone in distress.
@felineentity
@felineentity 3 года назад
This actually helps me with my jitter problem in my 2D game! Thanks!
@garbaj
@garbaj 3 года назад
Nice, glad I was able to help you
@avithedev
@avithedev 3 года назад
whats the 'mesh' equivalent in 2d?
@elijahm9234
@elijahm9234 3 года назад
@@avithedev Should be sprite
@trevoC132
@trevoC132 2 года назад
Not sure if I understand. IF in 3d this helps by seperating the mesh from the object that is moving, what is it doing in 2d? What are you seperating? the collision objects? (e.g. collision shape?) just confused.
@felineentity
@felineentity 2 года назад
@@trevoC132 You can use meshes in 2D.
@rafaelgpontes
@rafaelgpontes 3 года назад
This reminds me of techniques used in online multiplayer games. Interpolation plays an important role in smoothing the client-side animations regardless of low/laggy update packets coming from the authoritative server. Btw, you should definitely talk about multiplayer synchronization techniques! Things like client-side prediction and server reconciliation, etc. :)
@garbaj
@garbaj 3 года назад
I'm a noob at multiplayer stuff right now, but I hope to make videos on those subjects soon
@rafaelgpontes
@rafaelgpontes 3 года назад
@@garbaj I feel like people don't talk much about it because it's a complex subject. However, it's quite interesting and very useful for making socially appealing games.
@AJMarraffa
@AJMarraffa 5 месяцев назад
This worked for my fps camera great, thanks so much. For this wondering how to achieve the jitter fix for a first person camera, here's my current working code for Godot 4.2.2, which sits on the camera itself. A couple of notes: - linear_interpolate() has been shortened to lerp() -If you rotate the camera directly, your code will probably look more like Garbaj's. I had to modify it because of the way my player is set up. extends Camera3D @export var player_controller:PlayerController # The node with the script containing the player's direction var @export var player_eyes:Node3D # The node that rotates my camera. You might not need this. func _process(delta): self.global_basis = player_eyes.global_basis var fps = Engine.get_frames_per_second() var lerp_interval = player_controller.direction / fps var lerp_position = player_eyes.global_transform.origin + lerp_interval if fps > 60: # The value here should be the same as the project's physics ticks per second, as Garbaj said, # because the jitter comes from the game outputting higher FPS than physics ticks. self.set_as_top_level(true) self.global_transform.origin = self.global_transform.origin.lerp(lerp_position, 20 * delta) else: self.global_transform = player_controller.global_transform self.set_as_top_level(false)
@KonParas-p8s
@KonParas-p8s 5 месяцев назад
Im making a fps too and my controller (along with the hands and weapon of the character) is so good that its similar to Rainbow 6 "feel". So when I saw the jitter above 60frames I dropped my project completely and I was waiting for Physics Interpolation to be implemented in Godot 4. I will try your code, next week, and if it works I will continue my project! (I was asking a Godot contributor, and from what he told me Physics Interpolation, for 3D, wont be implemented soon..Im guessing probably in around a year or more maybe .. so lets hope we wont need it)
@AgnisNeZvers
@AgnisNeZvers 3 года назад
To reduce visual lag you can do a projected position. position + (position - prevPosition). The tradeoff would be a "glitch in the matrix" when a prediction is too different from the actual next physics position (should be minimal).
@garbaj
@garbaj 3 года назад
Interesting! I'll have to try this out. Your feedback has helped me learn so much about Godot over the past few months. I always look forward to your comments
@AgnisNeZvers
@AgnisNeZvers 3 года назад
@@garbaj And I'm always looking forward to your videos because you show stuff I haven't done yet. :D Also there's a Godot addon to do this, but it somehow didn't work for me. And you did what I suggested to that creator - set_as_toplevel to lift his limitations.
@xXYannuschXx
@xXYannuschXx 2 года назад
This is one of the things that Godot REALLY needs to improve; stuff like this should be handled automatically like in Unity. Recommending setting your monitor to 60hz or using a smoothing-addon is not good, especially for a beginner.
@ИванИванов-ю8у2е
@ИванИванов-ю8у2е 3 года назад
I am from Russia and do not speak English well. It is better to use get_physics_interpolation_fraction () for interpolation rather than get_frames_per_second (). If you use get_frames_per_second (), it is impossible to remove ALL the jitter/support/hangs. You have a special case, because fps ratio of physics and graphics 1/2 Try your code at different fps ratios of physics and graphics. For example - physics: 47fps, graphics: 60fps, etc. A slight tug will appear. --- var fraction = Engine.get_physics_interpolation_fraction() player_body.global_transform.origin = last_physics_pos.linear_interpolate(global_transform.origin, fraction)
@garbaj
@garbaj 3 года назад
thanks, I'll check it out
@garbaj
@garbaj 3 года назад
I tried it out and unfortunately it seems to make the jitter even worse. I'll keep testing it out though
@ИванИванов-ю8у2е
@ИванИванов-ю8у2е 3 года назад
@@garbaj Here is an example of the code that solves the problem with the appearance of a small model jitter when the fps of physics drops slightly relative to the fps of graphics pastebin.com/fqkCZphi P.S. player_body - Is a mesh. I.e. a visual representation of the player that is not a child node to KinematicBody.
@industrialdonut7681
@industrialdonut7681 3 года назад
I did almost exactly as you suggested with these two lines of code and my movement is literally smooth as silk now thank you XD
@crogersdev
@crogersdev 3 года назад
"i do not speak english well" comments in perfect english...
@maksscratch
@maksscratch 9 месяцев назад
THANK YOU!!!! Exactly what i was looking for! Really needed it for my 2d game... But i didn't want sprites to be set toplevel obviously, so a made a little change. I made a Vector2 "globals_sprites_position" variable that will replace global_transform.origin var FPS = Engine.get_frames_per_second() var lerp_interval = velocity / FPS var lerp_position = global_position + lerp_interval globals_sprites_position = globals_sprites_position.lerp(lerp_position, 20 * delta) Sprites.position = globals_sprites_position - global_position works just fine
@starosti8580
@starosti8580 5 месяцев назад
Hi, thank you for the snippet! I ran into some issues with your code where if you have some movement the moment game starts, the character jitters all over the place because FPS is set to 1 for the first second of the game, and also it caused issues with lower or dropping frame rates (like < 60 FPS), so I modified the code you provided to not interpolate if FPS is lower than physics FPS: var FPS = Engine.get_frames_per_second() if FPS > Engine.physics_ticks_per_second: var lerp_interval = velocity / FPS var lerp_position = global_position + lerp_interval globals_sprites_position = globals_sprites_position.lerp(lerp_position, min(delta * 50,1)) sprite.position = globals_sprites_position - global_position else: globals_sprites_position = global_position I hope this helps someone!
@benjaminborja5029
@benjaminborja5029 9 месяцев назад
My solution: If you are on a more modern version of godot, you can just go project settings>common>set physics fps from 60 to the refresh rate you need, you will need to re adjust your player speed but after that it's a definitive solution, then, from the inspector, check your camera process from idle to physics as well, jittering causes when stuff is not called simultaneosly, so assuring that player and camera updates are synchronized in my case removed the problem completely
@FerplayDev
@FerplayDev 7 месяцев назад
Bro you are a legend lool. Thanks so much for the comment. Fixed my problem!
@UC3wgyGGDLR8A_yB3MmK9oQQ
@UC3wgyGGDLR8A_yB3MmK9oQQ 6 месяцев назад
This is a lot more expensive though, because physics will be simulated at the rate you enter
@benjaminborja5029
@benjaminborja5029 6 месяцев назад
Yep, by the same reason, higher frame rate are more expensive, you should be doing this only if you intend a game running above +60 fps, if you're having jittering on a game running at 60 fps then I'll asume that this is not a solution
@UC3wgyGGDLR8A_yB3MmK9oQQ
@UC3wgyGGDLR8A_yB3MmK9oQQ 6 месяцев назад
@@benjaminborja5029 It depends on how complex the scene is I guess. Your CPU is doing a lot more work simulating physics than the GPU is rendering the scene. So even if you can pull 144fps on your game, your physics rate shouldn't be 144Hz; interpolation is better for that.
@benjaminborja5029
@benjaminborja5029 6 месяцев назад
Hmmm...the real question will be by how much it affects performance, as a game intended to be only for pc (in my case at least), if that means jumping from 2% to 3% cpu usage to getting rid of this will be a gladly cost to pay, at least until I find an interpolation method that works for me :(
@davidblaxxon7701
@davidblaxxon7701 3 года назад
i really like the format of these Godot engine tutorials, very concise and well presented information relevant to specific tasks that game devs need to code their own projects using this platform. Many thanks @Garbaj
@ZoepX
@ZoepX 3 года назад
You read my mind, I've been struggling with this this past week.
@jeremisaarinen8569
@jeremisaarinen8569 6 месяцев назад
Thank you so much for this tutorial, I was having such a headache trying to fix this
@nowherebrain
@nowherebrain 3 года назад
that's a good method. I had done something similar in the past by measuring the time between frames, honestly...your method is cleaner.
@hdhwkq
@hdhwkq 3 года назад
Boi for 3d iam just waiting for Godot 4.0 And now Learning 2d
@garbaj
@garbaj 3 года назад
why wait?
@epicredhot5675
@epicredhot5675 3 года назад
@@garbaj probably because the move_and_X functions don't play nice with slopes and/or jumping, depending on how you set them up
@garbaj
@garbaj 3 года назад
slope sliding has been fixed, and won't be changing in 4.0. I'll do a video on it soon
@hdhwkq
@hdhwkq 3 года назад
@@garbaj boi ur becoming the brakeys of Godot :D
@hdhwkq
@hdhwkq 3 года назад
@@garbaj ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-_VR-xHsio78.html
@moofymoo
@moofymoo 3 года назад
godot lately have an explosion of high quality tutorials.
@punpunmuk2751
@punpunmuk2751 Год назад
Just want you to know. I've been faced with this problem all over years and now everything has been resolved. Million Thanks!!!
@UC3wgyGGDLR8A_yB3MmK9oQQ
@UC3wgyGGDLR8A_yB3MmK9oQQ 6 месяцев назад
There's a really useful Smoother plugin for Godot 4 that can do this automatically just by adding a Smoother node to your scene tree!
@theARDISAN
@theARDISAN 4 месяца назад
Thanks this really made things a lot easier. Can also study the script it uses too for educational purposes.
@migats2160
@migats2160 2 месяца назад
Finally I found the right tutorial for what I want. But actually, I will still write my own way of jitter reduction for my intention specific.
@JeremyGardnerVideo
@JeremyGardnerVideo 3 года назад
This just helped me solve the mystery of why, after upgrading to a gaming monitor with a 144Hz refresh rate over my old 60Hz monitor, Godot suddenly seemed to have "broken" physics! Thank you! Your content is not such "garbaj" after all!
@drayodev
@drayodev 2 месяца назад
you could do alllllllllll of that or do this project > project settings > common (under physics make sure advanced settings are on) and set physics jitter fix to 0 this worked for me in godot 4.2.2!
@lionlight9514
@lionlight9514 3 года назад
Thanks! Garbaj Sometimes My player would just j-j-jitter everywhere at this fixed it!
@2nafish117
@2nafish117 3 года назад
Can you do a video about viewmodel rendering. separating the viewmodel fov and the main fps camera fov is something ive been looking around for. its possible to do using two cameras, one rendering the viewmodel to a separate viewport and then extracting that texture data and overlaying to the main camera. Ive been trying to implement this but have faced problems.
@zdez3071
@zdez3071 3 года назад
Amazing Video!! Keep the hard work buddy!
@algi1
@algi1 Год назад
Using _physics_process instead of _process already helped a lot, thanks. Jitter is so annoying.
@zombiegamer8243
@zombiegamer8243 4 дня назад
i was using the _process function before this, even just moving my movement to the physics process function has fixed the problem
@wormedw
@wormedw 4 дня назад
If anybody's running into this issue with Godot 4 go to Project Settings > Physics > Common and tick 'Physics Interpolation.' I do not know why it's not turned on by default
@sajberkg
@sajberkg 3 года назад
Can you make a complementary video (or text) showing how to do this on the camera like you talked about in the end?
@Tankerbox
@Tankerbox 3 года назад
ive been trying to figure out how to do that too
@kocraft137
@kocraft137 3 года назад
Can you make scopes with magnification? Probably do like a viewport in a mesh or something. I don't know. Would be nice
@garbaj
@garbaj 3 года назад
this video should get you most of the way there ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-K53bAYLXKDw.html
@kocraft137
@kocraft137 3 года назад
@@garbaj I meant something like this: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-GaKSdkVcSRo.html But in clean 3D
@garbaj
@garbaj 3 года назад
I see. Yes, you would use a viewport texture for that. I don't quite understand how it works yet, but here's the docs about it docs.godotengine.org/en/stable/tutorials/viewports/using_viewport_as_texture.html
@kocraft137
@kocraft137 3 года назад
@@garbaj Thx sm Garbaj. U are super helpful :)
@TackerTacker
@TackerTacker 3 года назад
Isn't the physics jitter fix option right below the physics fps at 0:25 meant for that? I thought I had read something like that about it, but idk if and how it works.
@bypell
@bypell 3 года назад
doesn't seem to work
@Shack263
@Shack263 4 месяца назад
There is a plugin for both Godot 3 and 4 that adds physics interpretation. I forget what it's called, but it should be easy to find.
@ahmadtakhimi6839
@ahmadtakhimi6839 3 года назад
Thank you for the tutorial. Can you please do a tutorial on 3D fog of war ?
@tux_the_astronaut
@tux_the_astronaut 3 года назад
Even though the interpolation causes input lag I think it gives the feeling of weight with the the character like there is some velocity to it
@LinxOnlineGames
@LinxOnlineGames 3 года назад
Your _physics_process() function has a minor bug, your object speed is not independent of update cycles. At the moment if you increased your physics to 60Hz, your object would move twice as fast. I recommend you use the delta passed in: direction = direction.normalized() * speed * delta ; This will ensure the object moves at a constant rate of 5 units per-second irrespective of your physics update rate. Interpolation will always lag behind the true state of the game world, the only way to get closer to the actual state of the game world is to increase the rendering rate, however you'll never reach the actual current state. In my own game-engine I built the interpolation into my 'draw' objects, this way the developer can update the position/scale/rotation of an object and leave the render to deal with the interpolation and frame rate passing.
@Nothing-rc4zc
@Nothing-rc4zc Год назад
Godot 3s move_and_slide method automatically multiplies the vector by delta, so his implementation is correct
@abbasimaaz7223
@abbasimaaz7223 3 года назад
Hey..! Uploaded good stuff man....I came here after my final term and I think you will be going to make cod or valorant like game from godot....
@Edel99
@Edel99 2 года назад
I believe they will be fixing this in Godot 4. I hope they make it transparent and automatic to the user, so we don't have to do this madness! thanks for the explanation.
@mirolotech9552
@mirolotech9552 3 года назад
I always had this Problem, now everything ist super smooth
@JustSomeRandomIdiot
@JustSomeRandomIdiot 3 года назад
1:14 It's probably not the correct solution but while I was trying to figure out how to fix jitter, I eventually just gave up and moved all my move_and_slide() code into the _process function and just multiplied all my movement vectors by 'delta' and defined my speeds for movement in terms of 'm/s'. Delta is always the length of time that has passed since the last frame. No matter how fast or slow the framerate gets, everything moves at the correct speed. Again probably not the correct solution for various reasons but after pulling my hair out for 2 weeks trying to fix the problems I had with jitter and sliding and other issues, doing that simple change just fixed everything so I said screw it and went with it.
@garbaj
@garbaj 3 года назад
The main issue I came across when splitting move and slide into process was that sometimes things like is_on_floor() would not work properly, which could mess with your ability to jump among other things. Highly recommended that you move everything into physics_process
@grindx1292
@grindx1292 3 года назад
can you do a tutorial on "earth bending"? So like raise the ground and take a piece out of it or something
@Icessien
@Icessien 3 года назад
He did a tutorial on making something like a wall you can just use that but replace the wall with a rock model then maybe animate it so it looks like it’s coming from the floor
@grindx1292
@grindx1292 3 года назад
@@Icessien yesh, but i want it so its actually the floor coming out the ground, so i can rock jump myself in the air if u know what i mean
@Icessien
@Icessien 3 года назад
@@grindx1292 lmao trying to think of a way..... maybe elevate the rock from the floor using a defined height range
@GeorgeGorge
@GeorgeGorge 3 года назад
Great video! However, things like this should be taken care of by the engine and not be fixed with hacky workarounds by the user.
@garbaj
@garbaj 3 года назад
While I don't necessarily agree that an engine "should" take care of it for you, because not every game needs the extra complexity, I can certainly understand the frustration of those who just want their game to look good right out of the box. Godot's developer is looking into adding built-in physics interpolation to the engine, but I think knowing ways to deal with it manually is also extremely useful.
@ChrisD__
@ChrisD__ 3 года назад
I'm pretty sure this same fix is coming in 4.0 as an optional feature.
@bypell
@bypell 3 года назад
​@@garbaj it should take care of it in every game that uses physics, 144hz+ gaming monitors are pretty common these days and playing a game that feels like it is locked at 60fps doesn't feel good at all. Having to hack a solution just so your game can feel smooth on modern gaming setups isn't right.
@shockwave1789
@shockwave1789 Год назад
Coming from Unity to Godot and Godot C# feels like there is no thought process or design behind implementation! everything feels like a mess & work-around.
@hoppalapasam53
@hoppalapasam53 3 года назад
gold like always
@AshnSilvercorp
@AshnSilvercorp 3 года назад
It doesn't look like a perfect solution, but a solution nonetheless. I'll save this tip for later if I ever need it.
@jtvalente
@jtvalente Год назад
I am using process delta for move and slide. I read that we should be using physics process. But there’s the frame rate issue. I will try to fix the issue with your suggestion
@jtvalente
@jtvalente Год назад
so if anyone is interested what I did is far less complex that doing a code based solution:Frame rate lock your games FPS to match the Physics FPS. Why? Well, even the suggested solution by this video suggests that collision shapes may not be in synch with animation. So it's not perfect. The best solution is to wait for Godot to release 2D/3D interpolation, or frame rate lock your game. Zelda is locked at 30FPS and is an amazing game.
@soundsbeard
@soundsbeard 3 года назад
intrepid on steam is a godot game which clearly has this jitter issue on camera.
@ZakariaIbrahim-ye4ws
@ZakariaIbrahim-ye4ws Месяц назад
thanks bro it helped Alot
@hypra7655
@hypra7655 3 года назад
Hey do potato laptop make games??😩😩😩
@kiryonnakira7566
@kiryonnakira7566 Год назад
i think i saw a video about how delta work and you just need to actualise half the value before moving the target and the other half after or something like that. Might be completely useless and not what you're searching for tho. idk
@Warionator
@Warionator 3 года назад
what about for rotation for a first-person controller?
@garbaj
@garbaj 3 года назад
pretty simple, if you're doing this on a camera it would be something like camera.rotation.y = body.rotation.y
@Tankerbox
@Tankerbox 3 года назад
@@garbaj could you please elaborate if you have the time thanks!
@欣伊-u1i
@欣伊-u1i 3 года назад
@@garbaj I am making fps, but when I rotate the camera, the weapons Lag sometimes, how to fix it?
@abbasimaaz7223
@abbasimaaz7223 3 года назад
Hey garbaj... Can u make a tutorial on adding hands to the fps gun.... I want but I am finding it hard...
@SnakeEngine
@SnakeEngine Год назад
Does it mean that you have to copy paste the interpolation code in _process() for every "interpolated" node?
@davidmurphy563
@davidmurphy563 3 года назад
Hmm.. I wonder world you save a lot of resources cutting the physics to say 20 and having process lerp at 60. It's collision that kills frame rate after all. I guess it depends on the game and you're best off playing with it. Nice tip, thanks!
@garbaj
@garbaj 3 года назад
Yes this is correct. Of course the lower you go with physics fps, the more input lag you'll have to accept, but that's just a matter of tuning/balancing
@carmo122
@carmo122 3 года назад
Would I need to regulate my animation speed to match with this added interpolation? Since the jitter and timesteps are very minute, I assume it wouldn't be necessary.
@garbaj
@garbaj 3 года назад
it probably wont cause noticeable issues
@saicoromero1180
@saicoromero1180 3 года назад
hello friend It would be great if you could do a quake style bunny jump tutorial if you have time greetings!
@ash.n51
@ash.n51 3 года назад
Nice vid but can you make one on a toggleable third-person and first-person viewer, like in minecraft? If that's possible. Or maybe just a ladder tutorial lol
@garbaj
@garbaj 3 года назад
Yes, it's a bit more complicated than this video, but it can be done
@ash.n51
@ash.n51 3 года назад
Pog. Looking forward to it
@Ngong8
@Ngong8 3 года назад
I still wonder if this method can fix my projectile bullets that sometimes didn't register collision issue or not, maybe I'll take some time to do this if I have time to spare.
@Ngong8
@Ngong8 3 года назад
Nvm I just found a solution from the godot community, I just need to add a raycast in my projectile bullet, will test if I'm not busy.
@mrdinoking6626
@mrdinoking6626 3 года назад
Can you please make a video on destructible terrain like minecraft but not blocky ?
@ejoojoo
@ejoojoo 3 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-mqlQ06hjtl8.html
@mrdinoking6626
@mrdinoking6626 3 года назад
@@ejoojoo thanks
@CactusTown
@CactusTown 2 года назад
thank you :)
@JasonTubeOffical
@JasonTubeOffical 3 года назад
I thought delta is used for this?
@adr1an29
@adr1an29 3 года назад
Thx it helped 🙏
@aenguspatterson4512
@aenguspatterson4512 3 года назад
Would a formula similar to this also work for updating rotational values rather than position?
@LinxOnlineGames
@LinxOnlineGames 3 года назад
It will, but there is an edge case. 0 and 360 degrees is the same position, if you were to linear_interpolate from 270 to 0 it would traverse the full 270 degrees instead of 90 degrees that's actually required. The below example is in radians, and deals with rotation on the x-axis, but the same logic can be duplicated to apply to y and z too. var diffX = abs( rotation.x - newRotation.x ) if( diffX > PI ) { rotation.x += (newRotationX > rotation.x) ? PI2 : PI } Note: PI2 = PI * 2
@RapiereGridoro
@RapiereGridoro 3 года назад
the ones that don't have monitor to see whats the diference =/ PS: btw the video is good :P
@tbcalfa1261
@tbcalfa1261 3 года назад
🤩🤩🤩🤩🔥🔥
@jurgitronik
@jurgitronik 2 года назад
Vhy would you create 3 variables for a single line command, you dont need that. The code will look messier, but it is no needed to befair. Would look messy but creating 3 new vars in scope and then destroying them when scope ends ir kind of redundant. Or have them as globals... creating variables every FPS if you have hunderds is kinda wasteful...
@gdmattartz3071
@gdmattartz3071 3 года назад
can you make a tutorial about portals? like in Portal 2?
@garbaj
@garbaj 3 года назад
Now that's a tough one, but maybe not impossible...
@ItsNoGoodJrGaming
@ItsNoGoodJrGaming 3 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-_SmPR5mvH7w.html not godot specific, but talks about how you'd go about making a portal in any game engine
@Relivino
@Relivino 3 года назад
Is it the same process for 2D as well? Wish I could have a solution for 2D.
@garbaj
@garbaj 3 года назад
It should be the same
@Relivino
@Relivino 3 года назад
@@garbaj Great, thanks for feedback! I have been struggling with jittering since 2.1!
@2nafish117
@2nafish117 3 года назад
A plugin exists for just this. lawnjellys fixed timestep interpolation plugin for godot. github.com/lawnjelly/smoothing-addon you should check it out. Although the problem with working with it is you need to restructure your scenes.
@2nafish117
@2nafish117 3 года назад
I have also taken a shot at making something that can be used as a plugin, although might not be tested enough. here is mine github.com/2nafish117/godot-interpolation-demo
@garbaj
@garbaj 3 года назад
I am aware of this plugin. I dunno if it works better than my solution or not, all I know is that my version uses 10 lines of code, while the plugin has over 100 lines of code.
@webnetweaverwebnetweaver9185
@webnetweaverwebnetweaver9185 3 года назад
Couldnt this also be fixed by turning VSync on? Godot Physics rate is set to 60 fps by default. VSync locks the framerate at 60 fps.
@voidzmhm
@voidzmhm Год назад
No cause if you would have a higher refresh rate monitor for example 144hz VSync would lock it to 144fps.
@quae6843
@quae6843 3 года назад
What about a 3D segmented snake tutorial? I am thinking about adding a snake boss (like in Risk of Rain or Terraria) to my game. I know how to implement similar thing in GMS2, but I have no clue how to make it in Godot with all three dimensions. I can't find any information about segmented "snakes", but this demo video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-9Iqo2ieiTFI.html
@sugaristhenewwhite
@sugaristhenewwhite 2 года назад
orrrrrr just use the smoothing node
@zagame4real609
@zagame4real609 3 года назад
so good and tasty
@camalienator
@camalienator 3 года назад
i wasn't able to translate this into a 2d fix, someone plz help, what do i put in place of the "mesh"?
@garbaj
@garbaj 3 года назад
My guess would be sprite
@camalienator
@camalienator 3 года назад
@@garbaj thanks!!
@archuraproject
@archuraproject 3 года назад
please throwing ax (by spinning) tutorial (like god of war)
@Chafmere
@Chafmere 3 года назад
I've never had this issue but also my PC is shit so...
@v_karna
@v_karna 2 года назад
нифига не андерстенд, но лайк поставлю
@breezy2official718
@breezy2official718 3 года назад
Can you make a tutorial for a fortnite style build system
@abbasimaaz7223
@abbasimaaz7223 3 года назад
Gonkee did it....
@breezy2official718
@breezy2official718 3 года назад
@@abbasimaaz7223 it’s not finished
@garbaj
@garbaj 3 года назад
It's way too complicated for me right now, but hopefully I can figure out a way one day
@breezy2official718
@breezy2official718 3 года назад
@@garbaj do you think I could maybe snap the deployable wall that you made to a grid and scale it
@garbaj
@garbaj 3 года назад
That's the basic idea. Getting the grid to work with the different wall types is difficult
@vinaychekuri5043
@vinaychekuri5043 3 года назад
Is there a reason not to use tweens ?
@garbaj
@garbaj 3 года назад
How would you use a tween for this?
@vinaychekuri5043
@vinaychekuri5043 3 года назад
@@garbaj nvm what I was thinking to do with tween is basically lerping so what you have done is much easier
@DragonSkorn666
@DragonSkorn666 3 года назад
I have a 2D project with a jittering problem, if I copy and pasted the code for my player would this help?
@garbaj
@garbaj 3 года назад
No, a simple copy paste will not work. I don't know what the 2d equivalent of global_transform.origin is, but that will need to be changed
@igorthelight
@igorthelight 3 года назад
Copying and pasting doesn't help - understanding the problem does :-)
@russellsheridan3957
@russellsheridan3957 3 года назад
Just turn on Vsync.
@russellsheridan3957
@russellsheridan3957 3 года назад
Joking btw
@Edel99
@Edel99 3 года назад
Shouldn't the engine take care of this?
@garbaj
@garbaj 3 года назад
At the moment no (same with Unity), but Godot's developer is looking into adding it as a built in feature.
@KacperGodfather
@KacperGodfather 2 года назад
@@garbaj it does in unity actually, you just tick the "interpolate" option in rigidbodys component
@giffiyt
@giffiyt 3 года назад
I'd use tweens instead
@garbaj
@garbaj 3 года назад
I'm curious to know how you use a tween to do this?
@giffiyt
@giffiyt 3 года назад
@@garbaj By using a function like this to move the mesh. var physics_fps = ProjectSettings.get_setting("physics/common/physics_fps") func change_pos(target_pos:Vector3): var tween = Tween.new() add_child(tween) tween.interpolate_property(self, "translation", translation, target_pos,1.0/physics_fps) tween.interpolate_callback(tween, 1.0/physics_fps, "queue_free") #Delete the tween node tween.start()
@Wodsobe
@Wodsobe 3 года назад
4:50 was that 69 intentional?
@garbaj
@garbaj 3 года назад
ummm...yeah..let's go with that
@Wodsobe
@Wodsobe 3 года назад
@@garbaj aight lol
@tengkuizdihar
@tengkuizdihar 3 года назад
Or you can use delta
@cristianjuarez1086
@cristianjuarez1086 3 года назад
Yeah unity is awesome
@tengkuizdihar
@tengkuizdihar 3 года назад
@@cristianjuarez1086 what?
@cristianjuarez1086
@cristianjuarez1086 3 года назад
@@tengkuizdihar delta is the change in time between frames. Unity has Time.deltaTime and returns how long took the last frame to load
@tengkuizdihar
@tengkuizdihar 3 года назад
@@cristianjuarez1086 i know that, but what's the connection between that and "unity is awesome"?
@5minutemovies977
@5minutemovies977 3 года назад
Why don't you just change the physics FPS and don't write all that extra code and all that stuff ?
@garbaj
@garbaj 3 года назад
I imagine you'd want to keep your physics fps low for performance reasons. Especially in multiplayer games
@ghghasemi
@ghghasemi 10 месяцев назад
for me work with disabling v-synce
Далее
On Screen Visual Effects (Damage) In Godot
2:10
Просмотров 16 тыс.
I Should've Tried Godot a Year Ago
8:25
Просмотров 56 тыс.
I tried coding my own graphics engine
4:23
Просмотров 206 тыс.
This is one of my favorite video game exploits
3:27
Просмотров 247 тыс.
Am I a femboy?
2:27
Просмотров 28 тыс.
How You Can Easily Make Your Code Simpler in Godot 4
6:59
'Sweats' vs 'Tryhards'
3:27
Просмотров 15 тыс.
Kernel level anti-cheat needs to go
3:27
Просмотров 43 тыс.
NEW Procedural Animation In Godot 4.0
9:26
Просмотров 157 тыс.