FriendlyCosmonaut

2.5K posts

FriendlyCosmonaut banner
FriendlyCosmonaut

FriendlyCosmonaut

@friendly_cosmo

🚀A friendly cosmonaut gamedev 💫 https://t.co/zfsaggeM98

Outer Space Katılım Temmuz 2017
444 Takip Edilen5.1K Takipçiler
FriendlyCosmonaut
FriendlyCosmonaut@friendly_cosmo·
godotnaut is very WELCOMING!! a little over eager but look they are rather socially anxious... #godot #gamedev
English
1
2
80
2.8K
FriendlyCosmonaut
FriendlyCosmonaut@friendly_cosmo·
@heliumfrog Aw thank you so much, it's so lovely to hear they were helpful - I hope it's been an enjoyable experience thus far ☺️
English
0
0
0
13
heliumfrog
heliumfrog@heliumfrog·
@friendly_cosmo I made the biggest strides as an early dev in GameMaker following your tutorials. It's so cool to see you in Godot now, too! enjoyed your work for many years, thanks for keeping it up
English
1
0
1
28
FriendlyCosmonaut
FriendlyCosmonaut@friendly_cosmo·
A new #godot tutorial that tries to answer... What are visual materials? Why are there so many slots for them!? Where do we put shaders and how do we use them? youtu.be/-hhwYgjRFc4
YouTube video
YouTube
English
2
6
63
2.4K
FriendlyCosmonaut
FriendlyCosmonaut@friendly_cosmo·
@SleepyMushroom2 @our_ta_martin Yup, it's semantically redundant, but gives explicit clarity to who the caller is/who our vars belong to. Especially in a code segment like this where the viewer doesn't have context of the rest of my code block, and indicates where someone could sub "self" with another node
English
0
0
3
112
Sleepy Mushroom
Sleepy Mushroom@SleepyMushroom2·
@friendly_cosmo @our_ta_martin You don't have to use self when getting an objects global position if it's on itself unless there's something in the project that requires you to do that
English
1
0
0
122
FriendlyCosmonaut
FriendlyCosmonaut@friendly_cosmo·
@RazorSharpFang @AnotherRatchet Yeah, absolutely getting to the point where we need some IK/bone constraints! This is showing locking the body's rotation to the y axis but letting the head rotate freely... still a bit uncanny, haha.
English
0
0
2
37
RazorSharpFang
RazorSharpFang@RazorSharpFang·
@AnotherRatchet @friendly_cosmo The proper thing to do would be to use the position of the head of the character - where its eyes are and then using that to make small adjustments to the other parts - neck can rotate a little, maybe the shoulders too, a bit of a chest swing. It's much more involved.
English
2
0
2
38
FriendlyCosmonaut
FriendlyCosmonaut@friendly_cosmo·
@our_ta_martin I reckon this is the most friendly solve/suggestion, especially without wrangling atan2/trig yourself! Thanks for stating it. For anyone else reading, this would be the below code (sub 'self' for whatever object is turning to face the other)
FriendlyCosmonaut tweet media
English
2
0
10
666
FriendlyCosmonaut
FriendlyCosmonaut@friendly_cosmo·
@Psyanim @ivanpopelyshev Oh my goodness I'm so excited and thankful for your work, it's such a good animation - I have watched it so many times to clarify trig concepts!!
English
0
0
0
83
FriendlyCosmonaut
FriendlyCosmonaut@friendly_cosmo·
An essential bit of gamedev math - atan2! We often know a target's position and want to face it. But how do we get the angle? angle = atan2(y / x) Or in 3D... angle = atan2(x / z) (We can also see below, what happens if we use atan instead of atan2) #godot #gamedev
English
13
171
2.5K
108.6K
FriendlyCosmonaut
FriendlyCosmonaut@friendly_cosmo·
@AaronRichter93 Oh interesting, but not sure I can imagine exactly what you're saying - do you have the bit of code specifically?
English
0
0
0
18
Aaron
Aaron@AaronRichter93·
@friendly_cosmo I used to get the look direction by calculating the distance and normalizing the vector to get a direction. Is atan faster? (it seems to be, just confirming haha)
English
1
0
0
46
FriendlyCosmonaut
FriendlyCosmonaut@friendly_cosmo·
@DeusIX_imxn Simplifying to just: rotation.y = atan2(target.position.x / target.position.z) Lets you do it in just one step!
English
0
0
5
255
FriendlyCosmonaut
FriendlyCosmonaut@friendly_cosmo·
@DeusIX_imxn As others have said, look_at is indeed using what we have described above, and there's merit in understanding that. But as well, if we JUST want to turn our person to look at the green object, but rotate ONLY on the y axis, then we have to do more work/undo parts of the function.
English
1
0
2
278
FriendlyCosmonaut
FriendlyCosmonaut@friendly_cosmo·
@ivanpopelyshev Look below (from mathwarehouse.com) - the target black circle/position, and the red and blue coords for y and x. Our triangle has to flip to solve for our desired angle: (I) y/x = + (II) y/-x = - (III) x/-y = - (IV) -x/-y = + Works fine for I & IV, but not the others!
English
1
0
3
104
FriendlyCosmonaut
FriendlyCosmonaut@friendly_cosmo·
@ivanpopelyshev Yes!! (And to expand for anyone reading) Compare the left/right side shown: atan takes one argument but atan2 has two - NEEDS two, in order to fix our "flipping" problem (shown left). Our right-angled triangle works fine in the first quadrant, but needs to flip in others!
English
1
0
1
610
FriendlyCosmonaut
FriendlyCosmonaut@friendly_cosmo·
@Si_Ro_Nin haha very fair 🫡 ...it's such a muddle switching between them, even moving between code and verifying in-editor, trying to present something intuitive but CLEAR
English
0
0
1
541
Si
Si@Si_Ro_Nin·
@friendly_cosmo Angles? Angles?! I only exist in radians and quaternions. Good DAY to you sir.
English
1
0
2
628
Sᴘᴏʟᴄʜᴇɴ
Sᴘᴏʟᴄʜᴇɴ@SpolchenDev·
@friendly_cosmo Freya has a good playlist for Math you devs could learn, a bit overkill maybe, but imo it doesn't harm to learn math in general lol
Sᴘᴏʟᴄʜᴇɴ tweet media
English
2
1
98
3.3K
FriendlyCosmonaut
FriendlyCosmonaut@friendly_cosmo·
I also have a Patreon if you want to support me making more videos like this! There's early access to videos, code repositories, voting on videos, code help, etc. patreon.com/c/FriendlyCosm…
English
0
1
5
329