Unity Bullet Shooting (Rigidbody Velocity) - Part 7 | Physics Layers (Sinhala)
Автор: EraganX
Загружено: 2025-11-21
Просмотров: 0
Описание:
අද අපි අපේ Tank එකට වෙඩි තියන්න (Shoot) පුළුවන් විදියට හදමු!
මේ video එකේදී, අපි මුලින්ම Bullet එකක් විදියට පාවිච්චි කරන්න සරල "Bullet Prefab" එකක් හදාගන්නවා. ඊට පස්සේ, New Input System එකේ "Fire" action එක (Mouse click) පාවිච්චි කරලා, ඒ Prefab එක Turret එකේ "Fire Point" එකකින් Instantiate කරමු.
ඊළඟට, ඒ Bullet එකට Rigidbody එකක් add කරලා, C# script එකෙන් Rigidbody.velocity දීලා ඒක වේගයෙන් ඉස්සරහට යවමු.
වැදගත්ම දේ: Bullet එක Tank එකේම (Player) වදින එක නවත්වන්න, අපි අලුත් Physics Layers දෙකක් හදනවා. ඊට පස්සේ Project Settings වල Collision Matrix එකෙන් ඒ layers දෙක අතර ඝට්ටන (Collisions) disable කරන හැටිත් බලමු.
Today we're going to make our Tank shoot!
In this video, we'll first create a simple "Bullet Prefab" to use as a Bullet. Then, we'll use the "Fire" action (mouse click) in the New Input System to instantiate that Prefab with a "Fire Point" on the Turret.
Next, we'll add a Rigidbody to that Bullet and use a C# script to give it Rigidbody.velocity to make it move forward quickly.
Most importantly: To stop the Bullet from hitting the Tank itself (Player), we'll create two new Physics Layers. Then we'll see how to disable collisions between those two layers using the Collision Matrix in the Project Settings.
Simple Tank Controller Playlist:
• Unity Top-Down Tank Game Tutorial (Sinhala)
New Input System Playlist:
• Unity New Input System (Complete Sinhala G...
#UnitySinhala #GameDevSinhala #UnityShooting #Rigidbody #PhysicsLayers
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: