GameObjects and Transforms [UnityQuickTips]

preview_player
Показать описание
[Unity3D] What are GameObjects and what are Transforms. Let's find out!
Рекомендации по теме
Комментарии
Автор

i knew what they were when i first started unity :p its one of the most simple but great video as allways !!!

SteamFireGamer
Автор

lowercase gameObject will return the the game object that that script is attached to. From there, for example, you could write . but sometimes it doesn't matter where the function is coming from, like .
transforms and rigid bodies work hand in hand, you'll likely always use both.

MasterIndieVR
Автор

Oh yeah, by hook or by coork LOL I will get this... I took programming years back and situations left me as a software tester...granted for a good company...but I have been getting backk into coding for a while, just changed direction and now am on java and unity :-)

mathieucormier
Автор

Eteeski, what would be the best way to go about adding footstep sounds to the FPS player? I have a detection system set up so that the sounds only play at the peak of the camera bob footstep:
if > .999){
Step();
}
However, if you stop walking at a position where the sin of headbobStepCounter > .999, the sound plays over and over again. And, sometimes the sound plays more than once per headbob, sometimes it doesn't play at all.

Henelik
Автор

@ETeeski2...I have a very interesting project, and while I am very interested in keeping things as "small company" as I can, it is a big idea. And it hasn't been done yet. That said, I would like to speak with you on either a friendly to consultant to employee/shareholder level, and see what happens ;-) Let me know if you may be interested in knowing more. Serious offer!

mathieucormier
Автор

Can you clear up the confusion I seem to get with lowercase gameObject compared to GameObject? I know GameObject is the class that holds most of the functions, but gameObject seems to have the same functionalities. When would you use either?

Also when would you use rigidbodies instead of Transforms in a physics based game?

tokenblakk
Автор

If I change the > to == it almost never plays the sound, as there is rarely a frame where the sin of headbobStepCounter is exactly equal to .999. I'm thinking there HAS to be a better way to this and have the footstep sound coordinate with the camera bob. Any suggestions?

Henelik
Автор

yeah 12 beers later and I am sure there are syntax errors somewhere ;-)

mathieucormier
Автор

Just make an empty GameObject, without any components

ivandonat
Автор

have it something like if (> .9 && !footstepSound.isPlaying)

MasterIndieVR
visit shbcf.ru