So I am making my first 2D platformer in unity using C#, and have noticed that collision is not detected between frames, meaning if my fps was 1, I could walk through walls, which is not what I want. To fix this I want to make it so that a point follows the player, updating every frame. The idea is that the point will draw a line to the player, and if that line intersects a given object such as the floor or a wall, it will translate the player’s position to the point instead of the point translating to the player.
Problem is, I don’t know how to create a line (or thin box would work I guess) between 2 points that acts as a trigger in C# script.
Is there a better way of doing this because if so I would appreciate that, although it would be useful to know how to create triggers anyway.
Thanks a lot guys.