Forum begins after the advertisement:


[Part 6] Bat gets stuck on platforms

Home Forums Video Game Tutorial Series Creating a Metroidvania in Unity [Part 6] Bat gets stuck on platforms

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13761
    Anuk Thotawatta
    Level 4
    Participant
    Helpful?
    Up
    0
    ::

    My bat enemy cant reach me if i am under a platform. How do i use raycast to make it avoid obstacles.

    #13770
    Terence
    Level 30
    Keymaster
    Helpful?
    Up
    0
    ::

    Anuk, having your bat do pathfinding around the platform will involve quite a bit of complexity. We go through some examples of raycasting in the series, and you will have to adapt that code to your bat to have it path around the platform.

    Alternatively, you can look into putting the bat in its own layer and adjust the Layer Collision Matrix in Unity, so that it can pass through platforms: https://docs.unity3d.com/Manual/LayerBasedCollision.html

    Or you can look into using this 2D NavMesh for Unity: https://github.com/h8man/NavMeshPlus

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: