I am trying to replicate this but for the life of me - I cannot understand how to get the collision for ground units to work
I tried extending my projectiles collision downwards…but the problem is when the bullet collision at the bottom collides…with the ground unit…it looks like the bullet goes PAST the ground unit due to perspective
as in this game it looks like its not exactly TOP DOWN…its angled slightly
Is there a way to somehow have things collide from the camera’s perspective?
Usually similar games detect collision in screen space, so every object have some “flat” collision in screen coordinates - points, circles and rectangles.
Well, it is not easy to make it in unreal.
I think you should try to extend ground objects collision to height of player shots, and player’s collision to height of their shots, and look how it works for you.
I do have the enemy collisions extended upwards - but with perspective it makes it look like the bullets are going “past” the enemy Mesh on the ground and hitting the collision at the top. (at the end of the video)
you did give me an idea though of what to look up - “screen space collision” I just wasn’t sure what terms to look up or what to even research for this kind of thing.
this solution is very expensive on mobile, you will have to cast to all classes every frame and compare their positions in space screen to your projectiles space screen.
I manage to it with tick and linetrace, don’t know if it is viable as ticks tend to be expensive.
First I separate the projectiles in two groups, on the player projectile and 2 enemy projectile.
The enemy projectile spawns at the players height, using a line trace to spawn at best location, so that projectile handle collisions normal as it is at the same height as the player.
The player projectile ticks every frame, doing a line trace for my object channel from the camera location in the direction of the projectile, I multiplied it to 10000 as I will not put any unit 2000 below the player, and I do have some spare length, but that value is up to you.