Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+6 votes

I'm planning to use raycast for my Player.
I'm hoping the raycast would detect an attack range for our character that uses a bow and arrow.
if the enemy is in range, it will show a label saying "shoot" or something to let the user know the attack would hit.
What do you guys think?

asked in CSC380Jan2024 by (2.5k points)

3 Answers

+3 votes

I could be wrong but I think this won't work. Ray casting I believe like shoots a ray that will end when it hits something. I think the best way to do your method would be a long collision shape although I could be wrong

answered by (3.8k points)

yes that would be good but using raycasting will give me a badge


Raycasting will work how they want it to. I use raycasting to judge the distance between the player and a wall in my game.

+3 votes

I think it's a pretty good idea. lmk if you implement it successfully I might ask you for assistance as I was thinking to add an almost similar feature to my game :)

answered by (3k points)

sure !

0 votes

This is a great idea. I used Raycasting in a similar way. I have it give a distance to a wall to the player, but it has a set range.

answered by (965 points)