I do not know half of the words you are saying BUT I will try to work out the script in my own mind. I just wanted to thank you, I have to do something similar for a school assessment as an aspect of the game I'm making and I was pretty stuck. So this was so good just to get the basics and a really good tutorial, thank you so much for this, I will dedicate my (hopefully) good grade to you!
Great tutorial, thank you. I see that you use get component in the Fixed Update which greatly affects the performance. I switched out the List onBelt, to List onBelt; So I never had to use get component at all. I thinking this should be less taxing on the framerates.
Ooo great tip. That could help a lot with lower spec devices! I've been using another engine lately and hadn't thought to make the list that specific. Thanks for sharing that! Just goes to show I should spend the time to figure small optimization things like that for future projects.
Op already cached the material reference in Start(), so line 24 was probably meant to be material.mainTextureOffset += new Vector2(0, 1) * conveyorSpeed * Time.deltaTime; Should run quicker than having the GetComponent firing every tick in Update, especially if you have multiple belts. Thanks for the tutorial.
I am attempting to follow this guide however only sphere colliders will actually move along the conveyors. I am unable to get cubes to work (crates). Is there something I am missing about how the physics works? Please advise
Depending on how you want it to act, you could try increasing the force on the conveyors so they can move the box. The box collider has a lot more friction than a sphere. By adding force it will try to roll the box/crate along the conveyor belt. You might want to try setting the velocity directly but it will snap the direction as it touches the next belt doing it this way. It will be tricky to get it to work as expected moving crates along with how I set it up in this video.
@@jayometric Thanks very much for the reply. I ended up using the spheres after all but freezing their rotation, then added my box as a no collider pure visual tag along. Smoke and mirrors :)
For this one, I had an invisible object above (just as a point for them to spawn from). I made a spawn script that uses a coroutine to instantiate the sphere prefab. I used a coroutine so I could have it call itself after a delay. There are a lot of ways it can be done. But Instantiate is the function that will create more objects.
Super great tutorial! Thank you so much!
I do not know half of the words you are saying BUT I will try to work out the script in my own mind. I just wanted to thank you, I have to do something similar for a school assessment as an aspect of the game I'm making and I was pretty stuck. So this was so good just to get the basics and a really good tutorial, thank you so much for this, I will dedicate my (hopefully) good grade to you!
Great tutorial, thank you. I see that you use get component in the Fixed Update which greatly affects the performance. I switched out the List onBelt, to List onBelt; So I never had to use get component at all. I thinking this should be less taxing on the framerates.
Ooo great tip. That could help a lot with lower spec devices! I've been using another engine lately and hadn't thought to make the list that specific. Thanks for sharing that! Just goes to show I should spend the time to figure small optimization things like that for future projects.
Op already cached the material reference in Start(), so line 24 was probably meant to be
material.mainTextureOffset += new Vector2(0, 1) * conveyorSpeed * Time.deltaTime;
Should run quicker than having the GetComponent firing every tick in Update, especially if you have multiple belts.
Thanks for the tutorial.
Good catch! I updated the github to match that. Seems I overlooked something so obvious. Thank you!
If you're trying to move a CharacterController instead of Rigidbody, you'll use Move instead of AddForce
I am attempting to follow this guide however only sphere colliders will actually move along the conveyors. I am unable to get cubes to work (crates). Is there something I am missing about how the physics works? Please advise
Depending on how you want it to act, you could try increasing the force on the conveyors so they can move the box. The box collider has a lot more friction than a sphere. By adding force it will try to roll the box/crate along the conveyor belt. You might want to try setting the velocity directly but it will snap the direction as it touches the next belt doing it this way. It will be tricky to get it to work as expected moving crates along with how I set it up in this video.
@@jayometric Thanks very much for the reply. I ended up using the spheres after all but freezing their rotation, then added my box as a no collider pure visual tag along. Smoke and mirrors :)
Thank you
no comments?
How did you spawn the spheres?
For this one, I had an invisible object above (just as a point for them to spawn from). I made a spawn script that uses a coroutine to instantiate the sphere prefab.
I used a coroutine so I could have it call itself after a delay. There are a lot of ways it can be done. But Instantiate is the function that will create more objects.
could you make a video about that? please @@jayometric