I learned so many little nuggets of gold in this video like the existence of a trail renderer, how to detect collision on a bullet better and how to use scriptable objects. honestly pure gold
@monkeyrobotsinc.987511 ай бұрын
8:20 ahhh hahahah i love that you dont edit out any mistakes and just keep going. super funny.
@IdealIdleIncremental Жыл бұрын
I've been working with Unity for over three years, yet I've never utilized ScriptableObjects. After watching your video, I'm definitely inclined to give them a try.
@StigDesign Жыл бұрын
i Highly recomend try to use it in your projects and try to get used to them, it made my menu selection of tracks and cars in 3d racing game so much more easy to manage, but it took time to get used to hov to make scriptable object and communicating with it hehe :D
@JoeTheis Жыл бұрын
I ended up using SOs in a very similar way before coming to this video. Nice to see I wasn't totally off base! A word of caution on the use of a c# property there: make sure that whatever calculation it is doing is really light weight OR precalculate and cache the value when the projectile is created. I ran into a problem in my game where stats like damage and velocity can be quite complex to calculate (think player bonuses, skills, buffs and debuffs, etc). If you do that every frame for every projectile, and you have hundreds of projectiles in flight (like is an RTS) it can actually show up in the profiler as a major bottleneck! In most cases, projectiles are short lived enough where recalculating that stuff every frame isn't gameplay relevant, but can definitely impact your framerate. Not sure I'd bother if I expected a low number of projectiles, or if the calculations were simple (neither was true in my case)
@MartKart8 Жыл бұрын
I feel like Imphenzia is the only person, I've noticed that can code and model with easy.
@PedrovoriskAB4 ай бұрын
Amazing this video because u work in the area. already created games and you are giving us valuable things u apply to ur own professional games.. amazing.. really thank you!!
@Songfugel4 ай бұрын
Thanks for the clear video on this simple, yet surprisingly hard to sell to veterans concept 9:32 Sorry if this is a bit late and besides the point of the video, but you might want to consider doing anything physics/visibility related like this inside the fixed update instead of the update method, due to the unpredictability that the update method can introduce at non-standard delays. This is exactly what can cause projectiles to go through hitboxes, speed up thousand fold or fail raycasts that they should be hitting when there is something (like gc lag or some legacy driver hickup in Unity) causing larger or smaller than expected intervals between update frames when it plays catch-up ps. also remember to to change to fixed delta if changing it to fixed update pps. in scenarios like this, you might also want to considering adding the projectile prefab inside the scriptable object, so depending on the ammo you use, you can change the projectile model and properties, without having to change both. But that is of course dependant on the requirements of the game itself, especially if all the projectiles should look the same. However, in much more complex SO blueprints (like weapons, classes, races etc) selecting prefabs manually, and not having them be selected by the SO can get very arduous and error prone
@Mad3011 Жыл бұрын
11:09 You can achieve the same behaviour by setting this.enabled to false. The most useful thing about ScriptableObjects for me is that you can tweak all those settings on the SO while the game runs, and the changes will persist when you exit playmode. Makes balancing weapons really nice and easy.
@Johan-rm6ec5 ай бұрын
Good point.
@YVoiceY2 ай бұрын
Just FYI, that Raycast Collision detection you scripted at 9:23 can be achieved with a Rigidbody and setting the Collision Detection to "Continuous" (not 100% sure it's more performant though). Calculating the collision detection in the Update Method as opposed to the Fixed Update seems also kind of weird, as tying the collision detection to the Framerate might lead to issues..
@DevGamerShripadAgashe5 ай бұрын
Hey Great video! I have a question regarding the use of ScriptableObjects for storing ammo data. You are using properties to calculate damage based on mass and velocity. My concern is about the overhead of calculating damage at runtime for every bullet instance. Is there a way to precompute this damage value within the ScriptableObject itself during the editing phase, ensuring it's already calculated and available in the final build? I'm looking for a method to avoid runtime calculations for each bullet. Your suggestions would be greatly appreciated! I considered adding it in OnValidate but that will not work for the final shipping build.
@Songfugel4 ай бұрын
Yes ofc there is. Just make a read only damage property that calculates and *caches* the value whenever *either* velocity or mass *is changed.* This is very useful and standard pattern in programming that you should find a lot of material on
@Briezar3 ай бұрын
you can cache it with OnValidate if it's a UnityEngine.Object, or via ISerializationCallbackReceiver if it's a plain object. Simply create a [HideInInspector][SerializeField] cachedValue and set it in OnValidate so that its value can be updated realtime inside editor and persists on builds. The gotcha here is that if you update the formula used for caching the value, you need to revisit all SOs that use that formula and trigger OnValidate (by changing anything) so it can re-serialize correctly. Or just write an editor method that fetches all corresponding SOs from AssetDatabase and update its cachedValue. TLDR: It's easier to just cache it on runtime instead like the guy above said.
@davidbaity739910 ай бұрын
Great gems of knowledge in this one! Thanks for sharing.
@StigDesign Жыл бұрын
I love this mix of videos , your game, 10min challenge and unity tip`s and tutorials/info with example :D lol i had to google what kilogram is but its the same as kilo :D yes Scriptable object is so awesome to use after having it properly set-up, i used it for my tracks and cars in the menu of my 3d racing game, and i think i probably use it in my ShipWrekers/OverBoard! inspired arcade boat game, and 3d fps game am working on at the moment :D Your learning videos is so much more different than other unity videos but it makes them so much more better and really easy`er to learn from :D
@rutchjohnson Жыл бұрын
Love the new Unity vids!
@chemp113 Жыл бұрын
Thanx, good lesson! 1 question: The bullets that fly further, Rnt needs to be destroyed after some positions? They just keep flying and have calculated?
@carzz185 Жыл бұрын
in my case, i'm making a vertical scroll shooter, so when the bullet goes further than the camera it is destroyed
@atibyte Жыл бұрын
Again a great video, thanks! I would like to watch more Unity videos from you.
@MrOmega-cz9yo Жыл бұрын
I've seen tutorials that use either ray casts or projectiles. This is the first vid I've seen that uses both at the same time. Interesting. Thanks! I would like to see how you handle object pooling for a large number of bullets.
@ragerungames Жыл бұрын
Great video. I am interested in knowing the procedure you used for grapple swing and the ability in which player goes back to its original position
@chrisp7414 Жыл бұрын
8:20 :D not exactly 420 related but funny nevertheless, nice way to explain ScriptableObjects. My understanding is that they're also used in games where data needs to persist between scenes s.a. an RPG with player characters leveling up and all the good character sheet stuff.
@picturize8047 Жыл бұрын
You are a hero
@juleswombat5309 Жыл бұрын
OK, where do we get that T shirt?
@oldborodach Жыл бұрын
Есть ли у вас курсы?
@carzz185 Жыл бұрын
so far i use scriptableobjects mostly for options menu... (volume, screen resolution, etc)