Unity Raycasting - 4 Examples

Поділитися
Вставка
  • Опубліковано 11 лип 2024
  • 4 simple examples of using raycasting, C#, and the Unity game engine. FPS or first-person shooting, selecting objects with a mouse, moving objects with a mouse, and checking is grounded for simple jumping.
    Sebastian Lague's Platformer Series: • 2D Platformer Controll...
    Want to support the Channel?
    *******************************
    Shop the Unity Asset Store (affiliate): assetstore.unity.com/top-asse...
    Become A Channel Member: / @onewheelstudio
    Or a Patron: / onewheelstudio
    Grab a T-Shirt: onewheelstudio.com/merch/
    My video and streaming kit: kit.co/onewheelstudio/tutoria...
    Buy a Game Design Book: kit.co/onewheelstudio/game-de...
    Video Gear List (Amazon Affiliate)
    ***********************************
    Sony A6100 Camera: amzn.to/32logXz
    Camera Lens: amzn.to/3KA4Wr4
    GoXLR (audio interface): amzn.to/35dmr03
    Shure SM7B Mic: amzn.to/3fNbV1E
    Blue Mic Arm: amzn.to/3tHgwdQ
    Neewer Light: amzn.to/3rD8eRv
    Light Softbox: amzn.to/3GUaHgQ
    Neewer RGB Light: amzn.to/3rCTQJ9
    Other Links
    ************
    Discord: discord.onewheelstudio.com
    Twitter: / onewheelstudio
    Devlog: onewheelstudio.com/
    Twitch: / onewheelstudio
    Timestamps
    *************
    0:00 What is Raycasting?
    0:22 Things You Should Know
    1:10 The Raycast Function
    1:48 Using Rays
    2:09 FPS Shooting
    4:22 Selecting & Clicking on Objects
    5:53 Debug Draw Line
    6:25 Moving Objects with Mouse
    8:18 Jumping - Check is Grounded
    10:02 RaycastHit
    10:50 Infinite Distance
    11:14 Raycast Performance
    11:52 THE END
    #GameDevelopment #Unity3D #raycasting #indiedeveloper

КОМЕНТАРІ • 15

  • @OneWheelStudio
    @OneWheelStudio  2 роки тому +2

    Was this a useful video? Learn something new?
    Raycasting blog post: onewheelstudio.com/blog/2021/12/15/raycasting-its-mighty-useful
    Project Files: github.com/onewheelstudio/Adventures-in-C-Sharp/tree/main/RayCasting

  • @HericksonWargames
    @HericksonWargames Рік тому +1

    Best explanation on Raycasting that I have seen on UA-cam.

  • @halivudestevez2
    @halivudestevez2 Рік тому +1

    Thank you for the tutorial. It looks advanced, goes further than the basic tutorials about raycasting.

  • @protopottygames2648
    @protopottygames2648 2 роки тому +2

    Oh maaan! A poking stick is such a great way to explain this to people.

  • @predsfan2
    @predsfan2 2 роки тому +2

    This has helped me a lot

  • @artyomm3965
    @artyomm3965 2 роки тому +2

    Your tutorials are cool! Thanks a lot and Happy new Year!

  • @mariegrasmeier9499
    @mariegrasmeier9499 Рік тому +1

    Thanks for the great tutorial and super comprehensive explanations!

  • @gasnurey8937
    @gasnurey8937 Рік тому +1

    Thanks for this Sir, keep it up

  • @arthurjvnb
    @arthurjvnb 2 роки тому +1

    Thanks for the tips and tricks :D

  • @haithammahmoud6825
    @haithammahmoud6825 2 роки тому +1

    thanks
    i'm watching all ur videos about new input system
    i thought u created this videos with new input system
    i really want to know how u get the mouse location for ScreenPointToRay

    • @OneWheelStudio
      @OneWheelStudio  2 роки тому

      That would be a great follow up video! I didn't want to get too deep into the weeds with this video ;)

    • @OneWheelStudio
      @OneWheelStudio  2 роки тому +2

      Also I believe with the new system you can call Mouse.current.position.ReadValue() and it should work the same as with the old system.

    • @haithammahmoud6825
      @haithammahmoud6825 2 роки тому

      @@OneWheelStudio no i will wait ur video xD thanks

    • @OneWheelStudio
      @OneWheelStudio  2 роки тому +2

      Well here you go! A new video converting the same examples to use the new input system. The video isn't released (yet), but I figured I share the link with you early ;)
      ua-cam.com/video/7MPhxKHMi4c/v-deo.html

  • @thesilentwisp
    @thesilentwisp 2 роки тому +1

    I like the different examples given but just moved a bit fast for me. You had one instance in the beginning where you explained each aspect of the raycast but it would have been helpful referencing back to them when explaining your code later on for the newbies like me.