How to create a top down game ability system like the game league of legends?

For those not familiar with league of legends you have over 100 characters all with different spells or abilities.

They have a particular ability system that allows you to click on the skill key like (Q) for example and then the ability may lunge in that direction. It may shoot an ability in that direction or it may also spawn an ability where the mouse is assuming it’s in range.

However one of the challenges with this system is making the abilities go to the location as if they were on a 2d plane.


For example in this image even though it’s a 3d game the cursor would be hovering in the center of where the ability circle is being shown. In Roblox if you made the ability go towards the mouse it would go down and hit the floor instead of going straight forward in the direction of the cursor.

I just don’t know where to start so I’m asking if anyone could give me advice on the direction to go, what to look into, ect
So I have an idea on how I can accomplish this. Many thanks!

Okay so I may be mistaken by your question, but what I understand is that you don’t want your attack to go down to where your mouse is but to follow the direction of the mouse. So what you would need to do in your script is just to ignore the Y axis and only use X,Z.

1 Like

I could have done a better job at explaining. I don’t really know how to start from scratch. Which includes like arguments (not sure if I’m using the right word here) to be able to code this or like an api-reference. Because I can’t find any documentation that really helps me with what I want to accomplish and I don’t know where to start. So I really wanted to know what I could look into to be able to start figuring this problem out.

1 Like

Well I think you should start with Cframes: CFrames | Roblox Creator Documentation

1 Like

Steps:

  1. Get mouse location in 3D space
  2. When the user clicks, send the mouse position to the server
  3. On the server, check if the ability is in range
  4. Fire ability

You will need a local script, a server script, a remote event, and the ability ready to use.

2 Likes