How to SHOOT 3D Object TO TARGET Position - Mouse Click Position | Unity 3D Tutorial

Опубликовано: 19 Октябрь 2024
на канале: Devsplorer
7,438
87

In this Unity tutorial, I want to show you how to shoot 3d objects to the target position in 3d space. Target position is calculated by mouse click position in world space. It is accepted that there is no drag force and gravity affecting the object. This way object moves with linear motion.

There are 3 behaviors/scripts each having its own responsibilities. Spawner spawns the Spawn and informs the SpawnShooter. SpawnShooter decides on the strategy to shoot the Spawn, such as linear motion or trajectory motion and prompts Spawn to move with the information needed. Spawn moves and sticks to objects with selected tags otherwise falls on collision.

🎯 Here I used mouse input to set the target position but feel free the change how you define the target position.

🤹‍♀️ I am motivated to continue on with this series of shooting objects to target with different approaches. My next plans include giving a spin to Spawn, shooting it with the trajectory motion, making it pass through the holes then stick to a wall, calculating scores using the collision position on target objects, etc. If these topics or similar ones that interest you, feel free to let me know in the comments ^^ (I am open to other ideas on 3d physics or VR)

👉🏼 Wonderful Assets from KayKit - Mini-Game Variety Pack:
https://kaylousberg.itch.io/kay-kit-m...
👉🏼 Changing Cursor Texture With Mouse Press:
   • How To CHANGE CURSOR Texture To Show ...  
👉🏼 Similar Shooting Series:
   • Drag & Shoot & 3D Unity Tutorial Series  

#TargetShooting #LinearMotion #UnityTutorial

👇
If you want to see more of this kind of videos, please give this one a LIKE and SUBSCRIBE for future ones. Comments & Feedbacks are always appreciated.
👆

🏹 Subscription Shortcut:
   / @devsplorer  

👋 If you are new here check out the CHANNEL TRAILER:
   • Welcome To Devsplorer | Game Dev Chan...  

00:00 Intro & Demo
00:37 Future Plans - Are you interested?
01:30 Environment
02:14 Behaviors In Editor
04:20 Code
09:29 Last Demo & Outro

Here are some written tutorials: https://devsplorer.wordpress.com/
I generally share sneak peeks of the next mechanics 👁‍🗨
Twitter:   / eccegd  
Instagram:   / devsplorer  

Have A Great Day!
Happy New Year!
See you in the next explorations :)