Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
I want to control a character with WASD and when you press the sword, you aim and slash with your mouse. Everything worked until I added a scrolling function and my sword aiming just went bonkers.
So, basically when you press the sword the arrow should always point to the mouse cursor. Because of the scrolling, it doesn't behave like that and I can't figure out why that is.
Anyone have a clue to what's going on here?
I had a look and didnt really see what you meant, the sword attack seems to work ok for me. One thing i noticed though was that your sword (the sword you click to unsheath and then you have the ability to attack) needs to be on a UI layer (so it doesnt move when the scroll screens and instead is on the screen wherever the player walks).
How to make a UI layer is covered in the early tutes.
Develop games in your browser. Powerful, performant & highly capable.
Heh yeah sorry. I'm a bit loopy after beating at it all day.
So, when you "unsheathe", I want the arrow to always point to the mouse pointer. As if the character is strafing around the mouse pointer. It works great when the screen scrolling is not there.
Thanks for the GUI tip, been trying to figure out how to do that :)
Ahh i see what you mean now, no worries.
In the part where you set your arrow :
it needs to be "angle(player.X,player.Y,mouse.X,mouse.Y)"
instead of "angle(player.X,player.Y,mouse.AbsoluteX,mouse.AbsoluteY)"
Oh scheisse! :)
Haha, no worries :)