Hello! I’m working on a game and the moves in the game are as follows; you create a swipe with your finger on the screen and the character moves to the opposite side of it.
This works correctly. What I don’t know is how to make an arrow to show my character’s movement direction and movement size according to my finger’s movement direction and pull size.
and i know you were going to do a mobile game i think? i dont know that i cant help you with taht thats really hard to me like impossible i dont even have an android phone to test
I think I didn’t ask my question correctly. I have a system as you can see in the video below. Everything is correct so far. What I want is to make a dynamic arrow that shows the direction the character will fly while I’m pulling.
There’s quite a number of ways to make an arrow, start by using a debug arrow, like so:
Once you have it going, figure out how you want it to look.
a 2d / 3d widget
a stretched mesh
a spline mesh component
particles (ribbon, most likely)
something else?
All of these could work, depending on what’s needed. If you’re not sure what method to choose, perhaps you could provide a visual reference instead. For example, at a glance this looks like a 2d widget:
Hello after a long time, I have reviewed and tried your message but unfortunately I could not adapt it to my project. My project is too late and I need help. Please find a way
Here I applied your post and the effect is as below. First of all, I would like to remind you that my camera is fixed, then as you can see, there is no movement in the opposite direction of the direction I shot and the arrow is not drawn properly. I will be very glad for your help.
This will allow you to rotate it around the pivot accurately. The arrow is made out of shaft and tip. You could make it out of a single element but then you’d need work with 9-slice margins to scale it appropriately and avoid distorted stretching.
when mouse / touch goes down, we record a couple of vectors and send them to the widget:
Material, there’s probably a cool and efficient way of drawing it purely in material.
Wouldn’t the 2D widget be more useful, am I wrong?
Not wrong. But I’d personally gravitate towards Spline + Spline Mesh Component or a Niagara Ribbon. Both live in world space and may end up looking much better in this instance. Rotating widgets leads to ugly aliasing that only pushing through a retainer box can make look half decent.
But this is an artistic choice that is, ultimately, up to you.
And lastly, in the above example the math could be done in pure 2D - would be probably less finicky, but then you’d need to send a 3d vector to the physically simulated cube anyway.