How do I have a gun controlled by the mouse?

Get help using Construct 2

Post » Thu Jun 25, 2015 1:08 am

So i have a very basic platformer engine made and i want the character to also have a gun attached to the character that is controlled by where the mouse is. But the character itself moves with the wasd keys
B
8
S
3
Posts: 28
Reputation: 686

Post » Thu Jun 25, 2015 2:34 am

pin the gun (position only) and in an Every Tick event do: Gun set angle toward position Mouse.X Mouse.Y
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Thu Jun 25, 2015 4:16 pm

jobel wrote:pin the gun (position only) and in an Every Tick event do: Gun set angle toward position Mouse.X Mouse.Y

Every tick event?
B
8
S
3
Posts: 28
Reputation: 686

Post » Thu Jun 25, 2015 7:38 pm

it's under System Event

but if you don't know what an Every Tick event is, you need to do a couple of the beginner tutorials so you fully understand what it is.
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Thu Jun 25, 2015 9:32 pm

jobel wrote:it's under System Event

but if you don't know what an Every Tick event is, you need to do a couple of the beginner tutorials so you fully understand what it is.

Will do,but for right now, it says mouse isnt a system expression or variable name in this scope
B
8
S
3
Posts: 28
Reputation: 686

Post » Thu Jun 25, 2015 10:17 pm

You do have to insert the Mouse object in the project. once.. right click -->insert....:)
working on Rally Racing
B
8
S
1
G
2
Posts: 48
Reputation: 1,076

Post » Fri Jun 26, 2015 1:58 am

Torpedo wrote:You do have to insert the Mouse object in the project. once.. right click -->insert....:)

You're a life saver.
B
8
S
3
Posts: 28
Reputation: 686


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests