Ideas on how to implement a cover system

What do you think will be the best approach on building this system? I want it to be simple, the player to be able to move along the cover and on pressing S he can just exit the cover

2 Likes

I’d need more clarification or reference to assist you in this. I’m not spoon-feeding - include any past attempts or existing code so I can solve the specific issue.

2 Likes

As @M_etrics said, more information.

A cover system?
Do you mean a war type game where the player is hiding behind cover?
Do you mean a vehicle that is hiding behind cover?
Do you mean a game where the player is hiding underneath blankets?
Do you mean a game where the player hides under objects and they cover the player in shade?

We can’t automatically know exactly what you mean. If your explanation included ALL the details we can help you better. Otherwise we are only guessing what you need, what you’ve tried, and how those attempts have made the issue better or worse.

1 Like

I think all of these do the same thing?
Whenever you click S enter some area.

2 Likes

I think the best way is to use raycasting to check if a wall object is near the player and then show a ui over the head of the player’s character to prompt him to take cover.

Check out this link for reference:

You can download the source and check the code for how they go through sticking the player character next to the wall.

2 Likes

Thank you for this resource. It’s exactly what I needed

2 Likes

It’s like a cover system that you see for example GTA V where you hide from the bullets

Thank the one who made it not me, but a heart would be appreciated… Best of luck!

1 Like