So i currently have a sprite drawn to look like an arrow. its on a seperate layer than game, on a HUD layout, 0 scroll 0x0 parallax. HUD works fine. Arrow angle is set to (Global VariableX), (Global VariableY), with events changing the variables to the current objective. I Find that the arrow function works, however since it is on a seperate HUD layer, its position doesn't actually move. How would I go about setting the arrow to point in the direction that the objective is in from the players orientation? I'm assuming that the answer is some sort of equation including player.x - objective.x etc, but i dont know what exactly it is, also, i may be over thinking it, and it may not be an equation at all. not to say there's any one correct way to achieve something. However, i feel like this is a fairly basic thing that i haven't seen covered , and did a quick search, so my apologies if this is answered a million times already. the final piece of code im looking for reads something along the lines of, set arrow angle at object from player position, i just dont know how to get the "from " part.
Arrow set angle(arrow.X,arrow.Y,targetx,targety)
cuts me off at the comma
Develop games in your browser. Powerful, performant & highly capable.
nvm, the angle was where i as messing up, didnt include the function so it wasnt reading corrrectly. thank you. and for anyone else having trouble with this, it ended up being angle(player.x,player.x,target.x,target.y) , but nevertheless the same. thank you much.