Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
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
Hello, I am currently making a platform game where every tick, the gun sets its angle to Mouse.X, Mouse.Y, but how can I make the gun move for recoil if it would go against this code?
Develop games in your browser. Powerful, performant & highly capable.
Here is a demo:
Thanks! Is it possible to do the same thing but vertically for a bullet spread? Like with a random recoil value that gets higher if you hold the click?
I don't understand your question, sorry. Here is a version for automatic fire:
No problem, I made a bullet spread instead, but still used your code to make a visual recoil on my guns. Thanks bud!
But is there any way to make in sort of that the recoil value doesn't take any crazy numbers?
You can use clamp() or min() expressions. For example, Set recoil to min(recoil+10,30)