Tweening in Godot 4.0!

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 พ.ย. 2024

ความคิดเห็น • 80

  • @queblegamedevelopment4143
    @queblegamedevelopment4143  ปีที่แล้ว +1

    Looking for a chill game dev community?
    Join our Discord server here: discord.gg/J7mqN4sV :)

  • @Arcanistor
    @Arcanistor ปีที่แล้ว +21

    Hey, just wanted to let you know that you are good at making tutorials and I appreciate the video! Audio quality is excellent, and you clearly thought through what you were going to say. Well formatted.

  • @baq99
    @baq99 8 หลายเดือนก่อน +1

    Thank you so much for this internet stranger. I spent hours trying to figure out how to rotate a sprite in game to smoothly align with a randomly changing vector2. You're a life saver!

  • @SleepDepJoel15
    @SleepDepJoel15 ปีที่แล้ว +10

    Extremely useful information with no extra fat. Very good! Thank you!

  • @timeSlidrGaming
    @timeSlidrGaming ปีที่แล้ว +8

    My only complaint is that you cut the video when you're showing what it does which defeats the point of showing it.
    Edit: Also, the function gets called twice because it gets called on mouse button down AND up so it's running the tween twice. I was running into some problems where the sprite would be in a random position. To fix it, you can modify the if statement
    if event is InputEventMouseButton and event.is_pressed() == true:

  • @ericmartine902
    @ericmartine902 ปีที่แล้ว +21

    Im brand new to programming and godot and i spent 11 hours today trying to get an object to tilt back 5 degrees clockwise then counterclockwise and back and forth... i tried writing a counter that counted from -10 to 10 and then counted from 10 back to negative 10 to simplify the problem since i was thinking id have to convert degrees to radians and use -1 to 1... SUBBED, will investigate this video tomorrow!

    • @neverknow2474
      @neverknow2474 ปีที่แล้ว +2

      do you need the tilting to be a constant thing? or only apply when somthing else happens? If its something repetitive that is always occurring such as a pendulum. You might want to look into an animation player. You would set the values of rotation and loop the animation. no script required

    • @ericmartine902
      @ericmartine902 ปีที่แล้ว +2

      @@neverknow2474 thanks! good fallback option or even a better solution. Would definitely like to see how it works with code though!!

    • @kimbaptempura4073
      @kimbaptempura4073 ปีที่แล้ว +1

      @@ericmartine902 Dude if you figure this shit out, let me know, I've been my beating my head against the wall using a tween to make a platform hover....I know about the animation player, but just can't really grasp these tweens. Instead of going back and forth the shit just flies out in one directio...so frustrating - on the verge of Hulking out and throwing my computer out the window

    • @queblegamedevelopment4143
      @queblegamedevelopment4143  ปีที่แล้ว

      I'll see if I can look into it when I'm by my PC and figure something out.
      You could probably just chain 2 looping tweens to achieve this, but I'll see what I can come up with :)

    • @ericmartine902
      @ericmartine902 ปีที่แล้ว

      @@kimbaptempura4073 func _ready():
      var tween = create_tween().set_loops()
      tween.tween_property(self, "rotation_degrees", 4, 2).set_trans(Tween.TRANS_SINE)
      tween.tween_property(self, "rotation_degrees", -4, 2).set_trans(Tween.TRANS_SINE)
      pass
      This is what i ended up using on my camera and it looks sick. And this is how i did the moving of the paddles side to side. (pong) func _ready():
      var tween = create_tween().set_loops()
      tween.tween_property(self, "position:x", 4.0, 1).set_trans(Tween.TRANS_SINE)
      tween.tween_interval(0.5)
      tween.tween_property(self, "position:x", 44.0, 1).set_trans(Tween.TRANS_SINE)
      tween.tween_interval(0.5)

  • @RedEyedJedi
    @RedEyedJedi 8 หลายเดือนก่อน

    This is amazing. It reminds me of using flash back in the day. I can't wait for my day off tomorrow so I can start playing with this. Thank you so much for this video. Subbed.

  • @adrian_codes_stuff
    @adrian_codes_stuff 11 หลายเดือนก่อน

    Easy, straight forward and I get the solution within the first 2 minutes of the video. Still useful stuff after that, thank you.

  • @manimonji6516
    @manimonji6516 10 หลายเดือนก่อน

    That was the best Godot tutorial I've ever seen! Thank you!

  • @deerdev6511
    @deerdev6511 ปีที่แล้ว

    You are a life saver! Ive been looking for this for ages! Thank you so much and have a great day!

  • @GiantPineapp
    @GiantPineapp 6 หลายเดือนก่อน

    Best intro out there, thank you so much!

  • @Betegfos
    @Betegfos ปีที่แล้ว +3

    Nice one! I would appreciate a tutorial on how to do Background Loading in Godot 4. The documentation seems to be wrong.

  • @vaibhavkrkm
    @vaibhavkrkm ปีที่แล้ว

    Absolutely wonderful explanation, needed help with tweens in Godot 4, thanks a lot!

  • @neverknow2474
    @neverknow2474 ปีที่แล้ว +2

    great video! thank you for the tutorial. I like the quick content style. straight forward to the point shows the code and it works. Seriously great!
    Ive been messing around with tweens myself on 4.0 and I was wondering if you know a way to grab all current tweens bound to a node similar to get_children()?
    I know you can call is_running, but that is only if you already have access to the tween.
    I am trying to find a way where i can queue up tween propertys like you do in the vid but with a new click. My thought it fist check for existing tweens with that property and if found then queue the tween_property rather than create a new tween and override the old.

  • @artdirectorgiraffe1003
    @artdirectorgiraffe1003 ปีที่แล้ว +1

    This was a great video! i needed info on tweens and got everything i needed! Thanks!

  • @VojtechLacina
    @VojtechLacina ปีที่แล้ว

    Very nice explanation, I like Your style of teaching in tutorials here on the channel. Thank You

  • @mjdevlog
    @mjdevlog 7 หลายเดือนก่อน

    This is so useful!
    I ended up using most of it!

  • @artemail6744
    @artemail6744 5 หลายเดือนก่อน

    I DID learn something! Thank you very much

  • @excellund7908
    @excellund7908 5 หลายเดือนก่อน

    This was super helpful. Thanks a lot!

  • @skyvendik
    @skyvendik ปีที่แล้ว +1

    Great! I would appreciate a tutorial on how to bind two tweens at once to start together

    • @rungeon83
      @rungeon83 ปีที่แล้ว

      2 months late, but you can just turn on the tween function "set_parallel(true)" so the tweens will run together. And if you want to have a tween happen after those two have run you can either "set_parallel(false)" or use the tween.chain().tween_property

  • @mrussoart
    @mrussoart ปีที่แล้ว

    Awesome! Thank you!

  • @FranciscoAnes
    @FranciscoAnes 9 หลายเดือนก่อน

    Thank you. You made this very easy to follow. 👍

  • @nobodyinparticular80
    @nobodyinparticular80 10 หลายเดือนก่อน

    Thanks man. This was just what I needed.

  • @3DotsFineArts
    @3DotsFineArts 8 วันที่ผ่านมา

    say i want to draw a line along the path the sprite2d took, how can we achieve this?

  • @FreeSisyphus77
    @FreeSisyphus77 ปีที่แล้ว

    Very informative!!! Thx for sharing

  • @jamesodonnell4771
    @jamesodonnell4771 ปีที่แล้ว

    Can I tween the width of a line2D node for my laser beam project?
    interpolate_property sure was handy..

  • @connorryzen7020
    @connorryzen7020 6 หลายเดือนก่อน +1

    Hi, can we use tween on visible ratio property of label??

    • @queblegamedevelopment4143
      @queblegamedevelopment4143  6 หลายเดือนก่อน

      Should be able to! :)

    • @flynnwillis7042
      @flynnwillis7042 6 หลายเดือนก่อน

      @@queblegamedevelopment4143 to write a tween, we type tween.tween_property($node_name, "property to tween", final value, time). So how are you gonna define the property visible ratio of label? I tried "visible ratio" and "visible_ratio" in place of "property to tween". They won't work....Please help.

    • @queblegamedevelopment4143
      @queblegamedevelopment4143  6 หลายเดือนก่อน

      @flynnwillis7042 not by my computer right now, but I'll check it out when I get home 👍

  • @nupko0
    @nupko0 ปีที่แล้ว

    Thank you so much for tutorial, I've finally managed to rotate my sprite set amount of degees using as_relative() with action_just_pressed left or right. But sometimes the sprite get stuck in weird angle when im pressing rotate right and left in quick succession or at the same time. Do you know any way of fixing that?

  • @DashMatin
    @DashMatin 4 หลายเดือนก่อน

    what about loops?

  • @meraklmuskulpesent8313
    @meraklmuskulpesent8313 ปีที่แล้ว

    Thanks. This really helped.

  • @ClassicRollPlayer
    @ClassicRollPlayer 11 หลายเดือนก่อน

    does this work for fading in and out or should that be an animation?

    • @queblegamedevelopment4143
      @queblegamedevelopment4143  11 หลายเดือนก่อน +1

      Depends on what you'd prefer, but personally I'd use tweening if the fading is the only value you want to animate.
      If you have a more complex animation, it might be easier to use a anim player

    • @ClassicRollPlayer
      @ClassicRollPlayer 11 หลายเดือนก่อน

      Thank you! I was able to make it happen easily with a tween and the modulate property!

  • @Crekpozer
    @Crekpozer 6 หลายเดือนก่อน

    Bro, that sweet voice in my ear... 😈😈😈

  • @MaulLerGamer
    @MaulLerGamer 6 หลายเดือนก่อน

    thank you so much!

  • @felfar197
    @felfar197 4 หลายเดือนก่อน

    thank you!!

  • @ViktorExp
    @ViktorExp 14 วันที่ผ่านมา

    Моменты с демонстрацией твининга дергаются видимо из за того что удаляли паузы между словами путем вырезания этих фрагментов из видео.
    Спасибо за туториал.

  • @summerWTFE
    @summerWTFE 5 หลายเดือนก่อน

    Elastic doesn't work well as an IN easing in most cases. How can I have a LINEAR in and ELASTIC out?

    • @queblegamedevelopment4143
      @queblegamedevelopment4143  5 หลายเดือนก่อน +1

      Hmm I don't think you can do this in Godot yet, although I think 4.3 might support custom curves for tweens!

    • @summerWTFE
      @summerWTFE 5 หลายเดือนก่อน

      @@queblegamedevelopment4143 Actually, it looks like GTweensGodot supports that already.

  • @tdc9009
    @tdc9009 ปีที่แล้ว

    Is there a way to lock input until the tween has finished? The tween.finished signal seems to fire off earlier than I expect allowing me to enter an input and allow a new tween to start before the first one has ended up at the final position.

    • @tdc9009
      @tdc9009 ปีที่แล้ว

      Figured it out. You need to add the line tween.finished.connect(FunctionName)
      and then change your variables in the function. I just thought signals worked like variables and I could just use them in an if statement to check them.

    • @gustavo3220
      @gustavo3220 ปีที่แล้ว

      tween.tween_callback(function_to_call_when_tween_is_completed())

  • @Switch620
    @Switch620 ปีที่แล้ว

    Nice info.

  • @OnyxIdol
    @OnyxIdol ปีที่แล้ว

    good job!

  • @knerf999
    @knerf999 ปีที่แล้ว

    so no more tweencurves? :(

  • @danipoplpl7053
    @danipoplpl7053 3 หลายเดือนก่อน

    how do you make code run after the tween is completed

    • @queblegamedevelopment4143
      @queblegamedevelopment4143  3 หลายเดือนก่อน +1

      You should be able to connect the Tween's "finished()" signal to your desired function 👍

    • @danipoplpl7053
      @danipoplpl7053 3 หลายเดือนก่อน

      @@queblegamedevelopment4143 thanks

  • @owenlloyd2528
    @owenlloyd2528 ปีที่แล้ว

    Thank you

  • @KRYTOY_EZHIK
    @KRYTOY_EZHIK ปีที่แล้ว

    hi! I wanted to ask how to resize an image using the code in 4 godot?

    • @queblegamedevelopment4143
      @queblegamedevelopment4143  ปีที่แล้ว

      Looks like you can use the 'resize(width, height)' function on an image (obviously in integers)

  • @soran2290
    @soran2290 ปีที่แล้ว +1

    Add more zoom

  • @bloxa1235
    @bloxa1235 ปีที่แล้ว

    nice vid, idk why u have 0 comments tho

  • @davidhopp7127
    @davidhopp7127 หลายเดือนก่อน

    Just keep up with Godot versions. The way things change can cause a lot of wasted time. Thanks.

  • @tinonoman5831
    @tinonoman5831 ปีที่แล้ว +1

    I laugh a little every time I hear tweener

    • @queblegamedevelopment4143
      @queblegamedevelopment4143  ปีที่แล้ว

      Lol it's even funnier when you explain this stuff to people who don't know anything about computers haha

    • @tinonoman5831
      @tinonoman5831 ปีที่แล้ว

      @@queblegamedevelopment4143 Lol, yep. I work as a data engineer. My wife after 10 years still doesn't know what I do.

  • @Staglaitor
    @Staglaitor ปีที่แล้ว +2

    Can you explain me why you choose gatot and not Unreal engine, because it is the Unreal engine is the highest achievement among the engines and the fee for use after the release of the game is not so big

    • @queblegamedevelopment4143
      @queblegamedevelopment4143  ปีที่แล้ว +6

      Personally I just like the Godot workflow better, and since I typically create 2D projects, it's much better suited for my situation. In the end though, it's all just preference. So although I highly recommend Godot for the modular structure of most of the systems, and the constant updates in development, UE5 is a much better engine if you're trying to focus on good 3D immersive rendering, or simply just like the workflow better.
      I'd recommend trying them both out for a while, and seeing which one you enjoy more :)

    • @neverknow2474
      @neverknow2474 ปีที่แล้ว +4

      To add on to what Queble stated. Unreal is also a much larger engine and takes much more work to optimize and run. Although it is a great engine, it is not the best engine. In the same way that a Ferrari is a great car for what it does, if I just need to go a block over to pick up some eggs from the corner store, a Ferrari is not required or even recommended.

  • @voidling2632
    @voidling2632 ปีที่แล้ว

    tween_property does not exist.

  • @mightymochigames
    @mightymochigames ปีที่แล้ว +1

    as_relative() saved me so much headache! Thanks for pointing that out!!

  • @Kaaxe
    @Kaaxe ปีที่แล้ว

    I've been led to believe I could use this tween business to make a smooth audio transition.
    func _ready():
    var enginestarting = create_tween()
    enginestarting.tween_property($EngineDriving, "Volume_dB", 8.0, 5.0) also tried with "Volume dB". Game just crashes and closes instantly

    • @queblegamedevelopment4143
      @queblegamedevelopment4143  ปีที่แล้ว

      Hmm that's odd, what's the error?
      It looks like the property is all lowercase (volume_db), so just make sure you don't have any typos :)

    • @Kaaxe
      @Kaaxe ปีที่แล้ว +1

      @@queblegamedevelopment4143 ah indeed, thanks! I also had a slightly lacking understanding of what the numbers represented, boy reading the docs sure helps :P