How do I make gun rotate only 180 degree

Get help using Construct 2

Post » Sun Oct 09, 2016 12:32 pm

Message: kab can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I am using the "Set angle toward(Mouse.X, Mouse.Y)" action to move the gun.However i want the gun to move only 180 degree max so that the gun don't do behind the chassis.How can i do this ?



Check the capx here --> https://www.dropbox.com/s/sejtue4q4wdrkdm/workingdemolatest.capx?dl=0
B
5
S
1
Posts: 32
Reputation: 389

Post » Sun Oct 09, 2016 12:45 pm

B
47
S
18
G
84
Posts: 2,273
Reputation: 49,800

Post » Sun Oct 09, 2016 1:06 pm

I looked at your project, I think maybe if you make an invisible object that has follows the Y position of the mouse always but only follows the X position of the mouse if it is in front of the truck. Then have the turret point at this object instead of the actual mouse position.
B
22
S
11
G
4
Posts: 96
Reputation: 3,542

Post » Sun Oct 09, 2016 1:10 pm

@plinkie i am using the r233 version of construct and hence i cannot open your example
B
5
S
1
Posts: 32
Reputation: 389

Post » Sun Oct 09, 2016 1:13 pm

Image

Although on second thought, you might want to be able to aim at all times..so this works for reversing the angle of the gun...

Image
B
47
S
18
G
84
Posts: 2,273
Reputation: 49,800

Post » Tue Oct 11, 2016 3:48 pm

Works perfect plinkie....Thanks
B
5
S
1
Posts: 32
Reputation: 389


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests