Godot Looking at Tutorial with bones : How to bones pose in Godot - Rotation towards AI target : RTS

Поделиться
HTML-код
  • Опубликовано: 10 дек 2024

Комментарии • 36

  • @kalvin90
    @kalvin90 7 месяцев назад +7

    One of the most underrated channels... Simple straight to the point

  • @aquietmonk
    @aquietmonk 7 месяцев назад +4

    Good stuff! Thank you for sharing this, much appreciated.

  • @joakotorres402
    @joakotorres402 4 месяца назад

    Thanks man! I was struggling very hard trying to fin a way to just rotate a Bone.
    In my case I used "get_bone_global_pose_no_override()" instead of "get_bone_global_pose()", because the a Bone that I wanted to rotate scaled down and lost its original normal position. That way I just modify the Rotation from the Basis of the Transform3D that I got using "get_bone_global_pose_no_override()" then apllied using "set_bone_global_pose_override()"with that same arguments you shown and problem solved.
    And again, thanks for providing the code!

  • @DarksiderDarmoset
    @DarksiderDarmoset 2 месяца назад

    Excellent tutorial, thank you!

  • @sam-xg6wq
    @sam-xg6wq 3 месяца назад

    saved me sooo much time dude, excellent tutorial🙌

  • @nowherebrain
    @nowherebrain 3 месяца назад +1

    you don't need to do the -Z thing..but it will add a few lines of code to cast the rotation to a var add 180deg on y and recast to the rotation...it's 2-3 lines tops...but I just can't model in blender backwards :)

  • @sploopst6868
    @sploopst6868 5 месяцев назад

    absolute king - thank you

  • @ZeroStas
    @ZeroStas 6 месяцев назад +2

    when I put, the bone drastically changes scale and I noticed head pos is snapped in place instead of following other bones's animation

    • @nanotechgamedev
      @nanotechgamedev  5 месяцев назад +1

      I should have pointed that this video will provide different results because your bones will be completely different than mine, so many issues can impact bones, like unsafe transformations with scalling, import issues, export issues, rig issues, relationship issues between bones, constraints being applied wrong, the simple answer to your problem is to isolate it, make a new brand skeleton in Blender and see how it works with your code, if it works then try to find the issue with your rig or bones, if it doesn't work and the skeleton is very basic, something is wrong with the code.

  • @Ah2o5b
    @Ah2o5b 5 месяцев назад

    Hey great tutorial thank you. I wanted to learn how do you view the bones x,y,z axes in blender I couldn't for the life of me find anything related to explain it . Most roll bone tutorials feature it and I can't see it on screen without knowing how to enable it.

    • @nanotechgamedev
      @nanotechgamedev  5 месяцев назад

      It's in the armature data > Viewport Display > [ ]Axes, the stickfigure icon when you select a armature; imgur.com/a/Rkt5xZ2

    • @Ah2o5b
      @Ah2o5b 5 месяцев назад

      @@nanotechgamedev worked great thanks alot

  • @njdarda
    @njdarda 7 месяцев назад +1

    this is exact problem that i was trying to solve. i couldn't figure out how to get the actual global transform of the bone. thanks for the video!
    what about performance impact? isn't doing this in physics_process for many units going to be expensive?

    • @nanotechgamedev
      @nanotechgamedev  6 месяцев назад

      Not really, by default on a blank project maybe, because the physics process by default is fixed at 60 frames per second, this means the function will be called 60 times per second, but you can change the physics frame rate on the project settings, on my RTS project, the physics framerate is smaller, because I am not using physics all that much due to perfomance of units collisions,
      If you use process() function, then it's based on the framerate of the game, nothing to do with the physics framerate, and if you are not using vsync that will lock your fps to 60 or 144, then the function can get called up to your framerate x times per second, if the fps is free, sometimes it goes up to 800 because perfomance is fast, which means it will call the process() function 800 times per second per object, then yea, it's a waste of perfomance.
      If you want to optimize this, you can create your own tick system, with an integer you can use the process function or the physics to determine a frequency by counting if that integer is at a given point, if not then increase by +1, if it is then reset back to 0, this way you only execute code at intervals you specify.
      Or just use a timer to update, another way to also control the frequency. On my project I tested with physics process for all the 300 units or so I am prototyping all using this looking_at code, and the perfomance got hit around 3~4 fps, good enough for me. This of course depends on your asset, polygon count, bone count, animation, and a lot of other things, my asset is optimized a bit,

    • @njdarda
      @njdarda 6 месяцев назад

      @@nanotechgamedev thanks so much for a detailed reply.
      i'm learning godot and your videos are incredibly helpful!

  • @alpisala
    @alpisala 2 месяца назад

    THANK YOU SM

  • @v44n7
    @v44n7 5 месяцев назад

    you are amazing!

  • @marcospampi7154
    @marcospampi7154 5 месяцев назад

    Hey mate. Great video here, I have question: I've rigged a vehicle in blender, can I use the same approach to move the wheels bones to the position of the simulated ones?

    • @nanotechgamedev
      @nanotechgamedev  5 месяцев назад

      The video show how to make bones look towards a given target using look_at with pose override, I don't know what type of vehicle you are trying to simulate but I believe you can do it like that, however I would advise you to look into Godot nodes that handle the physics simulation of vehicles, like VehicleBody3D, they should take care of the things you need to make a car in Godot,

  • @grarldbrown6812
    @grarldbrown6812 2 месяца назад

    Godot is still fresh, so there is plenty of experience to make

  • @guustavols
    @guustavols 6 месяцев назад

    thank you!

  • @ugochi-mu7mo
    @ugochi-mu7mo 7 месяцев назад

    how do you covert a transform into a vector?

    • @nanotechgamedev
      @nanotechgamedev  7 месяцев назад +2

      You don't, you probabilly want a axis from the transform, or the position of the transform, the transform itself is a structure that represents the combination of position + rotation + scale of anything in 2D or 3D, let's assume it's 3D.
      The transform does this by having a origin, which represents the position, which in code is The3DObject.transform.origin or The3DObject.position, and if you want the global transform or the global position of a transform, you call The3DObject.global_transform.origin or The3DObject.global_position.
      The rotation and scale are defined through a basis, which is a structure that will tell how something is scaled and rotated in 3D, the same concepts apply for 2D transforms but with one less axis. When you say you want to convert a transform into a vector, you can request the position of the transform, or a given axis from the rotation through the basis,
      Here are some useful links:
      docs.godotengine.org/en/stable/tutorials/3d/using_transforms.html
      docs.godotengine.org/en/stable/classes/class_basis.html

    • @ugochi-mu7mo
      @ugochi-mu7mo 7 месяцев назад

      @@nanotechgamedev thanks so much

    • @ugochi-mu7mo
      @ugochi-mu7mo 7 месяцев назад

      Im new to this channel by the way. For answering my question, and having amazing content, you just got a new sub

  • @serialexperimentsdave7213
    @serialexperimentsdave7213 6 месяцев назад +2

    I wish Godots IK system wasn't terrible

    • @nanotechgamedev
      @nanotechgamedev  6 месяцев назад +2

      Godot IK and bones has been through a lot of reworking with github devs like lyuma and tokage on github, I have hopes we will have a nice working IK system in the future,

  • @whoknows4728
    @whoknows4728 6 месяцев назад

    Next time make a little window so we can't see it at all

    • @ZeroStas
      @ZeroStas 6 месяцев назад +1

      Ctrl and Plus will increase browser's size with video player. Or just use Zoom in any browser

    • @whoknows4728
      @whoknows4728 6 месяцев назад

      @@ZeroStas it's visible fine except of a part code on right side that hidden behind the screen

  • @grosshypno
    @grosshypno 2 месяца назад

    may you ebashit in russian yazyc? )

    • @Papajoofable
      @Papajoofable Месяц назад

      nahuya

    • @grosshypno
      @grosshypno Месяц назад

      @@Papajoofable ok. ofc. pizdato anyway ) thank you. Ay dzhust podyebate )

  • @sayzal
    @sayzal 7 месяцев назад

    Doesn't work, unfortunately. Still a good video