YouTube2Text

Animations (Rigs, Editor, Tracks) - Roblox Advanced Scripting #20 (2024) — Transcript

by BrawlDev · 5,812 words · 774 segments · language en · Watch on YouTube

Full transcript

  1. 0:00what is this no seriously tell me what
  2. 0:04I'm looking at right now oh my God this
  3. 0:07thing is massive wait
  4. 0:10touch what am I touching
  5. 0:12[Music]
  6. 0:18here no no please make it stop make it
  7. 0:25stop now please all right let's think
  8. 0:27about what we just saw for a minute so
  9. 0:29this thing decided to dance after I
  10. 0:33pressed this button which literally
  11. 0:36makes no sense at all but I'm just going
  12. 0:38to go with it so it decided to play a
  13. 0:40little dance animation after I pressed
  14. 0:42this button and that actually made me
  15. 0:44realize that yeah animations they do
  16. 0:47make up a big part of Roblox because I
  17. 0:50mean look at me I'm literally being
  18. 0:52animated as I walk I'm being animated as
  19. 0:54I jump animation is just one of those
  20. 0:56things that are very essential to Roblox
  21. 1:00especially when it comes to characters
  22. 1:01or NPCs because animations give the
  23. 1:05players or characters or even NPCs that
  24. 1:09liveliness to them so in this episode
  25. 1:11I'm going to be showing you how to
  26. 1:12create an animation and how to add them
  27. 1:15into your game so that you know how all
  28. 1:18the stuff works out because creating
  29. 1:19animations is a very important skill to
  30. 1:21have when it be when it comes to being a
  31. 1:24game developer so that's what we're
  32. 1:25about to do but with that being said
  33. 1:27let's go straight into implementing
  34. 1:28animations on Roblox
  35. 1:30now that we understand it let's start
  36. 1:32implementing animations inside of our
  37. 1:33game now you're probably thinking right
  38. 1:35now where the heck do we even make
  39. 1:37animations if this is your first time
  40. 1:39doing it Roblox has this feature that
  41. 1:41allows us to create animations using an
  42. 1:44animation Editor to then publish that to
  43. 1:46Roblox and use that in our own game so
  44. 1:49I'm going to give you a basic rundown of
  45. 1:51how this editor works but first thing we
  46. 1:53have to do is that we have to add a rig
  47. 1:56to our workspace so that we can animate
  48. 1:59it and if you don't know what a rig is
  49. 2:00it's basically an object that has a
  50. 2:02skeletal structure where we can
  51. 2:05manipulate its parts and add animations
  52. 2:08to them to make it humanlike so if you
  53. 2:10imagine this NPC right here to have uh a
  54. 2:14structure for legs a structure for a
  55. 2:16torso a structure for arms and a
  56. 2:18structure for the head all of those
  57. 2:20combined make up a rig and so that's
  58. 2:23basically what we're going to do here is
  59. 2:25we're going to be adding our own rig to
  60. 2:27be able to animate with because we can't
  61. 2:29animate with just a part A Part alone
  62. 2:32isn't going to help us animate our
  63. 2:33animations we need a skeletal structure
  64. 2:36to be able to do this for us luckily
  65. 2:38Roblox allows us to do that as well so
  66. 2:41here's what we're going to do we're
  67. 2:42going to go on the top go to Avatar and
  68. 2:45we're going to click this button called
  69. 2:47rig Builder so if we click this then it
  70. 2:50gives us a bunch of options to choose uh
  71. 2:53a rig that we want to generate so we can
  72. 2:56choose an R15 or R six character we can
  73. 2:58choose masculine or feminine body uh and
  74. 3:01we have all these options that are down
  75. 3:03here now you can pick your own avatar to
  76. 3:07import or you can pick a block Avatar
  77. 3:09these are usually my go-to when it comes
  78. 3:11to generating a rig so I'm just going to
  79. 3:14pick my avatar but you can also pick
  80. 3:16block Avatar it doesn't really matter
  81. 3:18okay so now that we've pressed that um
  82. 3:20Roblox generated a rig for me uh using
  83. 3:23my own character and it added it to the
  84. 3:26workspace so we can take this and we can
  85. 3:28drag this around ever we want like we
  86. 3:31can go on the right side and open it up
  87. 3:33and we can see that everything here
  88. 3:35basically makes up our player's
  89. 3:37character if we were to play the game
  90. 3:39with my accessories and animate script
  91. 3:42uh all the parts that we need and just
  92. 3:44things like that so we have a rig now
  93. 3:46what we need to do is open up the
  94. 3:48animation editor so that we can start
  95. 3:51creating animations so on the top there
  96. 3:54should be another button called
  97. 3:55animation editor under the animation
  98. 3:57section so we're going to press this and
  99. 4:01what you should see down here is a new
  100. 4:03animation editor window I'm actually
  101. 4:05going to get rid of my output down here
  102. 4:07so that we can see it better um but yeah
  103. 4:09down here it says select a rig to
  104. 4:12animate or create a new rig by selecting
  105. 4:14rig Builder under the Avatar tab but
  106. 4:17since we've already created our rig
  107. 4:19we're just going to Simply click our rig
  108. 4:21and now down here it says create an
  109. 4:24animation to start so there currently is
  110. 4:27no animation for this rig that we just
  111. 4:28created so we're going to have to create
  112. 4:30a new animation we're just going to call
  113. 4:32this animation test one just because why
  114. 4:35not so we're going to hit enter and now
  115. 4:37what we should see is this grid down
  116. 4:40here while also seeing this animation
  117. 4:42editor with this timeline now we we
  118. 4:45basically have this timeline down here
  119. 4:47and if we click and hold this blue bar
  120. 4:50then we can drag this along the timeline
  121. 4:53from start to finish uh with the
  122. 4:55animation that we're creating there's
  123. 4:57also some other things like playing the
  124. 4:59animation or skipping the animation or
  125. 5:01looping the animation uh there's even
  126. 5:02more customizable options on the right
  127. 5:04side of the screen I'm going to go over
  128. 5:06some of these in just a little bit but
  129. 5:08for right now what you need to know is
  130. 5:09that this timeline is very essential
  131. 5:11when it comes to timely accurate
  132. 5:14animations when you're creating them so
  133. 5:16if you're not familiar with Roblox rigs
  134. 5:18especially R15 rigs essentially this
  135. 5:21character right here is comprised of 15
  136. 5:24parts that is the head the right upper
  137. 5:28the right upper arm the the right lower
  138. 5:31arm the right hand and the same thing on
  139. 5:33the left side then we have the upper
  140. 5:35torso the lower torso and then we have
  141. 5:38the left upper leg the left lower leg
  142. 5:40and the left foot and then the same
  143. 5:42thing on the right side so what we can
  144. 5:44do is we can select any of these parts
  145. 5:46like let's say the right upper arm for
  146. 5:48instance it's going to give us a
  147. 5:50rotation indicator to allow us to move
  148. 5:53this character's arm so because this is
  149. 5:55a rig if we moved let's say the upper
  150. 5:58arm then it's going going to also move
  151. 6:00the lower arm and the hand as well and
  152. 6:03as you can see when we did this there
  153. 6:05was two things that happened on the
  154. 6:07bottom left it shows us on a rig
  155. 6:09hierarchy that we changed the right
  156. 6:12upper arm and we can see it down here
  157. 6:14with the position and rotation we've now
  158. 6:16changed the the rotation to 45° this way
  159. 6:20um on the 0c timeline so this is another
  160. 6:24thing that changed it gave us this key
  161. 6:26frame that shows us that we were able to
  162. 6:30make a change to the animation at this
  163. 6:33specific time frame so let's say we
  164. 6:34decide to change this time frame to five
  165. 6:38I believe this is milliseconds but I
  166. 6:39could be wrong about that it's basically
  167. 6:41five frames down the line if we were to
  168. 6:43let's say now change our upper torso so
  169. 6:46I'm going to click on the upper torso
  170. 6:48and let's say we move it this way then
  171. 6:51what's going to happen is uh we added a
  172. 6:53new key frame at 5 seconds but if we
  173. 6:56let's say decide to move this back this
  174. 7:00way you can see that Roblox
  175. 7:02automatically animates the rig for you
  176. 7:05based on the key frames that you put
  177. 7:07down on the timeline so if we started
  178. 7:09back at zero it's going to start with my
  179. 7:12hand going out with my arm going out
  180. 7:15this way but since I added a key frame
  181. 7:18to move my upper torso this way when it
  182. 7:21reaches five frames it's going to frame
  183. 7:24by frame move to the key frame and if we
  184. 7:28let's say move this again to 10 seconds
  185. 7:30if uh we wanted to move this arm this
  186. 7:33way if for whatever reason then once
  187. 7:35again it's going to start at 0 seconds
  188. 7:37and then it's going to move according to
  189. 7:40uh the frames in between both key frames
  190. 7:43and now that we do have this what we can
  191. 7:45do is we can play the animation that we
  192. 7:48just created if we start back at the
  193. 7:50beginning and then we hit play then what
  194. 7:52we can do is preview the animation so
  195. 7:54let's hit play we can see that uh from
  196. 7:57when we started to the last key frame it
  197. 8:00played our animation and if we were to
  198. 8:02implement this in Roblox studio uh we're
  199. 8:05going to fire this animation and then
  200. 8:08it's going to stop right here and then
  201. 8:09completely stop the animation not freeze
  202. 8:11it but it's just going to stop the
  203. 8:13animation if we wanted to let's say Loop
  204. 8:14it then we can press this button to
  205. 8:16toggle looping animation so once this is
  206. 8:19on if we play this once then it's just
  207. 8:22going to keep looping the animation and
  208. 8:24this would also be uh apparent when we
  209. 8:28implement this in our game but we're not
  210. 8:29going to put looping on so we're just
  211. 8:32going to turn it back off okay so now
  212. 8:34that we have our first animation let's
  213. 8:36publish this to Roblox so how we're
  214. 8:38going to do this is we're going to click
  215. 8:41the these three little dots that's next
  216. 8:43these three little dots on the left side
  217. 8:45we're going to click this and then what
  218. 8:46we're going to do is say publish to
  219. 8:49roblocks and it's going to show our
  220. 8:52popup to create this animation so we're
  221. 8:53just going to call this test one and
  222. 8:56it's going to be created by me uh we
  223. 8:58don't really have to do much here except
  224. 8:59delete local instances I would recommend
  225. 9:02checking this on at least thinking about
  226. 9:04what this does I would say you should
  227. 9:06usually just have this on I don't really
  228. 9:07see much of a reason to have this turned
  229. 9:09off so that's what we're going to do so
  230. 9:11let's hit submit and now we should have
  231. 9:14our published uh animation so as you
  232. 9:18know when you publish an animation on
  233. 9:19Roblox it's going to give a customized
  234. 9:22ID so this is the ID that we're going to
  235. 9:24use to implement in Roblox Studio we're
  236. 9:27going to copy this and we're going to
  237. 9:29hit close and we're also going to back
  238. 9:32out of this animation editor now that we
  239. 9:34have our animation to use okay so we
  240. 9:37have our animation ID but how do we add
  241. 9:40this animation to our game um the first
  242. 9:43thing that we're going to have to do is
  243. 9:45create an animation instance with the ID
  244. 9:48that we just copied uh because this is
  245. 9:51going to be the animation within the
  246. 9:53game that we're going to use to animate
  247. 9:56inside of our game this is basically
  248. 9:57what it's going to look like if we let's
  249. 9:59say went onto workspace hit the plus
  250. 10:01sign and then we decided to search up
  251. 10:04animation uh we're going to click
  252. 10:06animation and it's basically and there's
  253. 10:08basically one property here that we
  254. 10:10really care about and that's going to be
  255. 10:12the animation ID and obviously this is
  256. 10:15going to be um the ID that we just
  257. 10:17copied when we uploaded our uh animation
  258. 10:20so we're just going to right click on
  259. 10:22this hit paste and then that should be
  260. 10:23the numbered ID right there and we're
  261. 10:25going to hit enter so now that we have
  262. 10:27our animation here that we just created
  263. 10:30let's also rename this to test animation
  264. 10:341 just for the sake of it we have our
  265. 10:36animation but how do we make it so that
  266. 10:38our character will be playing this
  267. 10:40animation what we can do is we can add a
  268. 10:43local script inside of our character uh
  269. 10:46to be able to play this animation after
  270. 10:49a specific after a specific number of
  271. 10:51seconds so that we can see that it's
  272. 10:53working properly uh what we can do is
  273. 10:56add a local script inside of starter
  274. 10:58character scripts this is usually where
  275. 11:01I would be uh using my animations it
  276. 11:03would be inside of the character and
  277. 11:05ideally the starter character scripts so
  278. 11:07we're going to hit the plus sign and
  279. 11:09we're going to add a local script and
  280. 11:12we're also going to take our animation
  281. 11:14and we're going to put this right inside
  282. 11:17of our local script so that we have easy
  283. 11:19access to it so what we're going to do
  284. 11:21is make reference to our animation by
  285. 11:23saying local animation equals script and
  286. 11:27we're also going to throw it in a wait
  287. 11:29for child statement as well uh so that
  288. 11:31the script has enough time to look for
  289. 11:33it so it's going to be test animation
  290. 11:36one so this is going to be our animation
  291. 11:37script now in order to activate this
  292. 11:39animation we're going to need access to
  293. 11:41our character's humanoid because the
  294. 11:44humanoid is what makes our character
  295. 11:47lifelike humanlike and those sorts of
  296. 11:49things uh so what we're going to do is
  297. 11:51make reference to our character and as
  298. 11:53you know anything that's contained in
  299. 11:55starter character scripts is going to be
  300. 11:57a direct child of our character so it's
  301. 12:01so our character simply is just going to
  302. 12:03be the parent so we're just going to say
  303. 12:05local character equals script. parent
  304. 12:10and then through that we're going to
  305. 12:12find the humanoid of that character so
  306. 12:15we're going to say local humanoid equals
  307. 12:18character weight for child
  308. 12:22humanoid so we have access to our
  309. 12:25characters humanoid now now here's
  310. 12:27here's the weird thing about this so we
  311. 12:29actually can't use this animation
  312. 12:32directly uh for the character that we're
  313. 12:34trying to animate what we have to do is
  314. 12:36convert this animation to an animation
  315. 12:39track and this is essentially the
  316. 12:42animation that contains everything that
  317. 12:44we need in order to play back an
  318. 12:47animation and use it whenever we want
  319. 12:49because if you see our animation right
  320. 12:52here the only thing it has is animation
  321. 12:55ID it doesn't have any special
  322. 12:57properties that allow us to configure
  323. 12:59run or even or even stop or do anything
  324. 13:04with this animation that we have it has
  325. 13:05no properties which is why we have to
  326. 13:07convert this animation to what's called
  327. 13:10an animation track instance that allows
  328. 13:12us to do all these things so here's what
  329. 13:15we're going to do we're going to say
  330. 13:17local animation track equals humanoid so
  331. 13:22what we're going to do is we're going to
  332. 13:23take our humanoid and we're going to
  333. 13:26load in our animation that's going to be
  334. 13:29embedded within the humanoid so we're
  335. 13:31going to say humanoid colon
  336. 13:34load animation open and close
  337. 13:37parentheses and then we're going to
  338. 13:39throw in our animation inside of our uh
  339. 13:43arguments here so now we have an
  340. 13:45animation track and this is embedded
  341. 13:48directly into our character's humanoid
  342. 13:50well uh our players humanoid when we
  343. 13:52when we join into the game okay so now
  344. 13:55that we have our animation track we can
  345. 13:57play our animation using the play method
  346. 14:00in the animation track uh so what we're
  347. 14:02going to do is we're going to wait a few
  348. 14:04seconds so that our character can load
  349. 14:06into the game before we play the
  350. 14:08animation so we going to say task. wait
  351. 14:115 Seconds uh and then we're simply just
  352. 14:14going to say animation track colon play
  353. 14:17open and close parenthesis that's it
  354. 14:19that's all we have to do so now if we go
  355. 14:22into the game hit test and hit play once
  356. 14:25we're in the game after about a couple
  357. 14:27seconds it should play the animation on
  358. 14:29its own all right so I'm into the game
  359. 14:31after a set amount of time then we
  360. 14:34should see that the animation did play
  361. 14:37but it was very subtle because the
  362. 14:39animation lasts like 6 milliseconds or
  363. 14:42something uh and another thing was that
  364. 14:44it didn't fully played the animation
  365. 14:46because it was being overridden by our
  366. 14:49idle animation because it's quite
  367. 14:51confusing we played the animation but it
  368. 14:54wasn't what we animated it to be it
  369. 14:56barely lifted our arm and it barely
  370. 14:58moved our character why is that the case
  371. 15:01I'm going to show you once we move back
  372. 15:03into the animation editor okay so I'm
  373. 15:05going to go back to the animation editor
  374. 15:08and use our rig I'm going to move this
  375. 15:10down here so that we have a good view of
  376. 15:12it so what happened when we played the
  377. 15:14animation it certainly did not do this
  378. 15:17that's for sure it like kind of it sort
  379. 15:20of moved the arms up and it moved our
  380. 15:22characters torso to the right side just
  381. 15:24slightly but why did it do that why is
  382. 15:26it not doing this I want to understand
  383. 15:29the concept of what's known as animation
  384. 15:32priority and so when our character is
  385. 15:35playing the game our character is
  386. 15:37constantly playing an animation which as
  387. 15:40you know it's the idle animation if we
  388. 15:42have multiple animations playing at the
  389. 15:44same time like the idle animation plus
  390. 15:48this animation that we're trying to play
  391. 15:50then it's going to try to uh prioritize
  392. 15:53one animation over the other and if both
  393. 15:56of them are in the same priority then
  394. 15:58it's going going to be some weird
  395. 16:00mixture of the two so what we have to do
  396. 16:04is we we have to add more priority to
  397. 16:06our animation over our idle animation
  398. 16:10and the way we change our animation
  399. 16:11priority is by going on the left side
  400. 16:14here clicking on the three dots and
  401. 16:16there should be an option that says set
  402. 16:18animation priority so these are
  403. 16:21basically all the options for our
  404. 16:22animation priority and just to put
  405. 16:24things into perspective core is like the
  406. 16:27least priority
  407. 16:29option as you can see down here there's
  408. 16:31idle which is basically our idle
  409. 16:33animation so core is underneath idle
  410. 16:36what we want is to put this above idle
  411. 16:39and usually the best place to do this is
  412. 16:41in action because action has more
  413. 16:44priority over Idol but it also has more
  414. 16:46priority over movement let's say if our
  415. 16:48character was moving since we can say
  416. 16:51this is basically an action so instead
  417. 16:53of core we're going to set this to
  418. 16:55action so now that we've done that there
  419. 16:58isn't any visible change to this thing
  420. 17:01but we've now added more priority to
  421. 17:03this animation and in order to see our
  422. 17:05change what we have to do is publish
  423. 17:08this game to Roblox again so we're going
  424. 17:10to hit the three dots we're going to hit
  425. 17:12publish to Roblox and we're going to
  426. 17:14overwrite an existing asset which is
  427. 17:17going to be our test one right here so
  428. 17:19we're going to hit submit and now our
  429. 17:21animation should be updated uh our ID is
  430. 17:24still the same so we don't have to worry
  431. 17:25about that but let's now go into the
  432. 17:27game and see what happens with our with
  433. 17:30our animation now that we've updated our
  434. 17:32animation
  435. 17:34priority okay and as you can see we were
  436. 17:37able to see that our character was fully
  437. 17:39able to move to the right and we were
  438. 17:40also able to uh wave our hand up fully
  439. 17:44because it completely overrode our idle
  440. 17:47animation until this animation stopped
  441. 17:51so that's an interesting thing to know
  442. 17:52about when it comes to animation
  443. 17:54priority when you're creating your
  444. 17:56animations okay but now there's more
  445. 17:58animation properties that I want to
  446. 18:00quickly go over um when it comes to the
  447. 18:03animation editor and also what we can do
  448. 18:05through script so so here's what I'm
  449. 18:08going to do I'm going to extend our
  450. 18:11duration of these key frames so that it
  451. 18:14can appear slower so that we can
  452. 18:16actually see the animation happen so I'm
  453. 18:20just going to move these along so that
  454. 18:22once we play the animation then we
  455. 18:23should be able to see it better so yeah
  456. 18:26now we have like a better glimpse of
  457. 18:28this animation looks because it's closer
  458. 18:30to being a full second rather than
  459. 18:33stopping like halfway through or
  460. 18:35something like that I'm also going to
  461. 18:36turn on looping so that when we play it
  462. 18:39once we can constantly see it playing
  463. 18:42from start to finish and then start to
  464. 18:43finish and then start to finish and then
  465. 18:44you get the idea so let's now publish
  466. 18:48this back to Roblox by overwriting our
  467. 18:51already existing animation so we're
  468. 18:53going to go to test one submit and then
  469. 18:56there we go so now I'm going to
  470. 18:57introduce you to some more more
  471. 18:58properties with animation track that we
  472. 19:00can use to further continue animating to
  473. 19:04further continue using our animation so
  474. 19:07I want to introduce you to some notable
  475. 19:09Properties or methods that people may or
  476. 19:12may not be confused about um so I don't
  477. 19:14want this to be an in-depth guide to
  478. 19:17scripting animations on Roblox if you
  479. 19:19want to experiment with the stuff
  480. 19:21yourself you can go on the Roblox
  481. 19:22developer Hub I'll also put a link to
  482. 19:24that in the description to just see what
  483. 19:26there is that animation track has to
  484. 19:28offer that you can try yourself but one
  485. 19:31of those things that people may be
  486. 19:32tripped up about is this method called
  487. 19:34adjust speed so we have our animation
  488. 19:38playing uh that is playing at normal
  489. 19:41speed that lasts for 0.9 seconds but if
  490. 19:44we want to adjust the speed to be
  491. 19:46something faster we can add a multiplier
  492. 19:48to the normal speed of our animation
  493. 19:52track so by default the animation speed
  494. 19:54is one but if we want it to be let's say
  495. 19:57twice the speed then we're going to put
  496. 19:58down two as our speed that we want to
  497. 20:01adjust the animation to so it's going to
  498. 20:03look something like this we're going to
  499. 20:05say animation track colon adjust speed
  500. 20:10and then in parentheses we're going to
  501. 20:11put 0 point let's say two so that it's
  502. 20:16very slow whenever we decide to play the
  503. 20:18animation uh once we're in the game so
  504. 20:21let's see what happens if we go into the
  505. 20:22game and hit
  506. 20:25play all right and as you can see the
  507. 20:27animation is playing very slowly until
  508. 20:30it reaches the end and then it Loops
  509. 20:32back to the beginning so this seems to
  510. 20:34basically work as expected however there
  511. 20:37is something that I do want you to keep
  512. 20:39in mind when it comes to adjusting the
  513. 20:41speed you have to be very careful about
  514. 20:43using adjust speed when it comes to your
  515. 20:45animations that you're trying to change
  516. 20:48so we have adjust speed set equal to
  517. 20:520.2 after we played the animation track
  518. 20:55but let's see what happens if we take
  519. 20:57adjust speed and place it before playing
  520. 21:00the animation let's go into the game and
  521. 21:02see what happens now when we do
  522. 21:05that what ends up happening is adjust
  523. 21:08speed gets completely ignored and the
  524. 21:11the animation is playing at normal speed
  525. 21:13despite us wanting to change the speed
  526. 21:16of the animation and here's one thing
  527. 21:18that I can hypothesize about why this
  528. 21:21happens so if we go back to our script
  529. 21:23animation track colon play essentially
  530. 21:26what this does is it plays the animation
  531. 21:29at normal speed regardless of if you
  532. 21:31changed the speed of the animation track
  533. 21:34so if we hit play then it's going to
  534. 21:37start initially at the normal speed so
  535. 21:41in order to change the speed of the
  536. 21:43track that's currently being played we
  537. 21:45have to adjust the speed after we play
  538. 21:48the animation and that's my hypothesis
  539. 21:50on it I don't know if that's true but it
  540. 21:53seems to make sense if that is the case
  541. 21:55so that is one thing I do want to
  542. 21:57mention when it comes to adjusting the
  543. 21:58speed of the animation because I've had
  544. 22:00this issue many times in the past and
  545. 22:02this has confused a lot of people we
  546. 22:04have the ability to detect when an
  547. 22:05animation is playing and when an
  548. 22:07animation is stopping or those sorts of
  549. 22:09things but one thing we don't know is
  550. 22:12knowing when we've reached a certain
  551. 22:15point within the animation so if I were
  552. 22:17to go back to my animation editor let's
  553. 22:20say we were at this let's say we were at
  554. 22:23this point specifically how can we tell
  555. 22:26if we reach this point point of the
  556. 22:29animation what we can do is use what's
  557. 22:32called a marker to mark this specific
  558. 22:35frame within the timeline so that once
  559. 22:38we play the animation and we reach this
  560. 22:41point within the animation then we're
  561. 22:44going to tell our local script to
  562. 22:46activate an event because we've reached
  563. 22:48this point in the timeline so here's how
  564. 22:51we add a marker we're basically going to
  565. 22:54be in the timeline that we want to add
  566. 22:55this marker in and we're going to right
  567. 22:57click and say add animation event here
  568. 23:01so we're going to hit this button and
  569. 23:03it's going to show this window so what
  570. 23:04we can do is add an event here by
  571. 23:06clicking on add event and it's going to
  572. 23:08give us two boxes one of them for the
  573. 23:11event name and the other one for a
  574. 23:12parameter so for the event name what
  575. 23:14we're going to do is give it a name so
  576. 23:17we're probably just going to say like
  577. 23:18halfway and then what's interesting is
  578. 23:21we can add a parameter here and I'm
  579. 23:24going to show you what this parameter
  580. 23:25does but for right now we could just say
  581. 23:27something Rand like parameter one it
  582. 23:30doesn't really matter too much you can
  583. 23:32even leave this blank if you want but
  584. 23:35what we're going to do is hit save we
  585. 23:36can see this little marker placed on
  586. 23:38this time frame right here so now what
  587. 23:41we're going to do is go and publish this
  588. 23:44into robloxs again so that we can have
  589. 23:47an updated animation when we script our
  590. 23:50when we script it okay so let's go back
  591. 23:52to our script so let's drop two lines
  592. 23:54down here and what we're going to do is
  593. 23:56we're going to use a function that
  594. 23:58allows us to detect when we reach a
  595. 24:01certain point in the timeline to
  596. 24:03activate an event so this is what it's
  597. 24:05going to look like we're going to say
  598. 24:07animation track colon get marker reached
  599. 24:12signal and what we're going to do here
  600. 24:15is say open and close parentheses and
  601. 24:17we're going to specify the name of the
  602. 24:19event which if you remember it was event
  603. 24:22one and we're going to connect this by
  604. 24:24saying colon connect by creating a
  605. 24:27function open close parentheses and then
  606. 24:29in here we're going to add in our
  607. 24:31parameters which if you remember we did
  608. 24:33that when we created our marker so then
  609. 24:36we're going to hit enter and so now
  610. 24:37whatever we do inside of here it's going
  611. 24:40to fire after we trigger this event one
  612. 24:43marker in the animation ideally when we
  613. 24:45reach it when we're playing the
  614. 24:46animation so for right now what we can
  615. 24:48just do is just print out whatever the
  616. 24:51parameter is inside of here it's called
  617. 24:54halfway I seem to be forgetting things
  618. 24:56for some reason okay but let's go back
  619. 24:58into the game and now see the change for
  620. 25:01ourselves all right and as you can see
  621. 25:04once we're halfway through our animation
  622. 25:06it's being printed out in the output our
  623. 25:09parameter that we specified uh inside of
  624. 25:12the event when we created it in the
  625. 25:14animation editor so it's going to
  626. 25:16constantly do this because we have the
  627. 25:18animation looped uh if you remember from
  628. 25:20the timeline it's basically going to be
  629. 25:22in the halfway mark uh to signify that
  630. 25:25the event has been fired and it's going
  631. 25:27to print out our parameters down here so
  632. 25:29this is how we can detect when we reach
  633. 25:31a certain frame in the animation and I
  634. 25:34recommend doing it this way because I
  635. 25:35know there's other ways of doing it like
  636. 25:37key frame reached but that's generally
  637. 25:39not recommended when it comes to this so
  638. 25:41that is basically how you detect When
  639. 25:43You Reach certain frames within the
  640. 25:44animation so for this last part of the
  641. 25:47video I want to debunk two very common
  642. 25:49misconceptions that people have about
  643. 25:51animations so that you don't go through
  644. 25:53with these issues the first one is that
  645. 25:55it's not possible to access animations
  646. 25:58that are created by other people
  647. 26:00directly using their animation within
  648. 26:02your own game or if this was an
  649. 26:05animation that was created within a
  650. 26:07group that's not being used by that
  651. 26:09group owner what I'm trying to get out
  652. 26:11here is that Roblox has this privacy
  653. 26:13policy when it comes to sharing
  654. 26:15animations if let's say you had a game
  655. 26:17that was created within a group if the
  656. 26:19animations are not created within that
  657. 26:22group directly then you can't use the
  658. 26:25animation in your Roblox game if this
  659. 26:28was a game that was created by a single
  660. 26:30player all animations that are used
  661. 26:33within that game has to be created by
  662. 26:35the owner it cannot be you can't use an
  663. 26:38animation that was created by other
  664. 26:40people so you might think oh well okay
  665. 26:42if I can't use animations created by
  666. 26:44other people then I basically just have
  667. 26:46to create all my animations from scratch
  668. 26:49and to that I say technically yes but
  669. 26:52there are workarounds when it comes to
  670. 26:54this so it actually is possible to use
  671. 26:57animations created by other people if
  672. 27:00that person created a rig with an
  673. 27:03animation saved onto it and uploaded it
  674. 27:05as a model so I'm going to show you an
  675. 27:07example of what this looks like so I'm
  676. 27:09going to go to the toolbox and I'm going
  677. 27:10to search up something like club penguin
  678. 27:14dance and then there should be this
  679. 27:17animation right here with this rig so
  680. 27:20I'm going to open up this character and
  681. 27:22there should be something here called
  682. 27:24anim saves that basically saved all of
  683. 27:26the animations that are within this
  684. 27:28character but you might notice that this
  685. 27:30is a key frame sequence this is not an
  686. 27:32animation so when we open this up we
  687. 27:35have all the key frames within the
  688. 27:37timeline to have a real animation it's
  689. 27:40just now we have to convert this into an
  690. 27:43animation that we can upload to Roblox
  691. 27:45so what I'm going to do is I'm going to
  692. 27:47go to the animation editor and I'm going
  693. 27:50to go and hit the three dots and I'm
  694. 27:52going to create a new animation so I'm
  695. 27:54going to call this uh dance one so
  696. 27:58from what we see here we have all the
  697. 28:01key frames in this timeline to be able
  698. 28:03to play the animation so if I play the
  699. 28:05animation then you can see that the club
  700. 28:06penguin dance is being played right here
  701. 28:09which is very fascinating like this this
  702. 28:11was created by another person so with
  703. 28:14this in mind we have the animation here
  704. 28:17and what we can now do is publish this
  705. 28:20animation to Roblox as if it was our own
  706. 28:23animation so this could be our club
  707. 28:25dance we're just going to call this club
  708. 28:27dance one and we can now uh check this
  709. 28:30off hit okay and now we have our own
  710. 28:33animation that we can play so we can hit
  711. 28:35copy hit close and what I've decided to
  712. 28:38do was I've created a local script that
  713. 28:41basically um fires that basically plays
  714. 28:44an animation if I decide to hit the r
  715. 28:46key using user input service but before
  716. 28:49I can test this here's a conflicting
  717. 28:52issue if we go to the character we can
  718. 28:55see that this guy only has six parts if
  719. 28:58we don't include the humanoid root part
  720. 29:00this follows an R six character model
  721. 29:03what we were working with before was
  722. 29:04following an R15 model so in order for
  723. 29:08us to use this animation we ourselves
  724. 29:11have to be an R six character so we're
  725. 29:13going to have to switch over to an R six
  726. 29:16model so I'm going to go to my so I'm
  727. 29:18going to go to my avatar and quickly
  728. 29:20change myself to an R six character
  729. 29:21because if you're an r-15 character you
  730. 29:24can't use R six animations and the same
  731. 29:27thing works with the other way around
  732. 29:29okay so I've now loaded into the game
  733. 29:31using an R six character so I only have
  734. 29:34six parts not 15 if I hit R then it
  735. 29:37should be playing the club penguin dance
  736. 29:39animation because I have successfully
  737. 29:43been able to take somebody else's
  738. 29:44animation that's free of use and I
  739. 29:47uploaded that myself under my own
  740. 29:49profile and I'm now able to use it in my
  741. 29:51own game so this was just something I
  742. 29:53wanted to address when it came to
  743. 29:56animations and so miscon ceptions that
  744. 29:58may come about when it comes to this
  745. 30:00because I was very confused with this
  746. 30:01stuff in the past so so I want you to be
  747. 30:03aware of these sort of things when it
  748. 30:05comes to uploading animations onto
  749. 30:07Roblox and using other people's
  750. 30:09animations but with that being said
  751. 30:11we've now reached the end of the video
  752. 30:13and if it felt like I went really fast
  753. 30:15with this video I apologize because
  754. 30:17animating is a whole sector when it
  755. 30:20comes to game development and there's a
  756. 30:23lot of things that go on when it comes
  757. 30:24to creating animations and uploading
  758. 30:27them so this video wasn't an in-depth
  759. 30:29guide to animating but at least from
  760. 30:31what we can say so far from this video
  761. 30:34we were introduced to the animation
  762. 30:36editor we were able to create our own
  763. 30:38animations and understand the editor a
  764. 30:40little bit and Implement them inside of
  765. 30:42Roblox studio and also address some
  766. 30:45concerns and misconceptions that
  767. 30:47animations might have when it come that
  768. 30:50an that you might have when it comes to
  769. 30:52animations if you were to work with
  770. 30:53these down the line so with that being
  771. 30:55said that's going to be it for this
  772. 30:57episode I hope you found this video to
  773. 30:58be very informative and I will see you
  774. 31:00in the next episode take care

About this transcript

This page contains the full transcript of Animations (Rigs, Editor, Tracks) - Roblox Advanced Scripting #20 (2024) by BrawlDev, generated from the public captions YouTube serves with the video. The transcript has 5,812 words across 774 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.