Moving and performing action when in action range

First of all, thank you both for replying ! You really made my day. Being a noob it wasn’t very easy to understand your suggestions but you gave me more stuff to think about which is always good. I’m going to try both your suggestions to see which works best for what I’m trying to do and which one can be expanded further.

I started with @Bevman00 's suggestion with using a timer since it seemed a bit easier to implement. Had a few hiccups but I’m at a point where it works as suggested, I’m not sure that the way I did it is correct or a bit overkill.

Here is what I understood:

I had to do some digging since I’ve never used timers before and also decided to use an event rather than a function because it felt weird to have a function do 2 things : check for range and interact when in range. Did I get this correctly, that the function/ event is supposed to do both?

Thank you for you suggestion, it’s doing what I wanted. Here’s a video with how it looks right now:

You can see at the end of the video already my next problem with the tick event, I’m thinking once I have an animation for attacking I can just loop the animation if mouse button is clicked

@Everynone I will now try your suggestion and get back to you because I really liked how you explained it and the gold example is something I would like to have in game. I’m not sure I can get this working by myself but I’ll get back to you when I hit a wall.

Again, thank you both for you help, really appreciate it !

1 Like