How do I rotate an object on its axis

Just started using Construct 2? Post your questions here

Post » Tue Jul 05, 2016 8:22 pm

Hello everyone,

I recently started with Construct 2 and it has been great so far seeing how much it can save time and facilitate the prototype process. :D

I have been trying to solve this issue and I tried to check numerous resources but for some reason I just can't quite crack it.

I simply need to rotate an object with a bullet behavior when I spawn it. I have tried the Rotate angle behavior which has caused the bullet to simply change trajectory.

I also tried something like self.Angle + 45 * dt but still the direction changes.

Can this be done without having to use animation ?

Thanks
B
7
S
3
Posts: 8
Reputation: 646

Post » Tue Jul 05, 2016 9:10 pm

Don't have C2 right now so I only rely on the manual

You need to set the parameter of the bullet behavior "set angle" to no, then you can rotate it as you wish without affecting the trajectory

Set angle
If set to No, the behavior will never change the object's angle. If set to Yes, the behavior always sets the object angle to the angle of motion.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Tue Jul 05, 2016 9:12 pm

99Instances2Go wrote:The options ...

Set Angle in the Bullet behavior on/off combined with:
Rotate by changing the self.angle
Rotate by changing the self.Bullet.AngleOfMotion
Rotate by the behavior.

https://www.dropbox.com/s/g27wmouy2jh7w ... .capx?dl=0
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Jul 06, 2016 1:27 pm

Message: powerof2 can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
Aphrodite wrote:Don't have C2 right now so I only rely on the manual

You need to set the parameter of the bullet behavior "set angle" to no, then you can rotate it as you wish without affecting the trajectory

Set angle
If set to No, the behavior will never change the object's angle. If set to Yes, the behavior always sets the object angle to the angle of motion.


Thank you for the rapid reply.

When I set the angle to "No", I started having spawning issues. I have a canon that shoots objects from its set image point. As you can see in the quick note I attached, the objects no longer spawn as needed.

https://dl.dropboxusercontent.com/u/689 ... 0Angle.jpg

Here is how I spawn the objects:
https://dl.dropboxusercontent.com/u/6896957/Spawn.png
where throwpower is a positive number.

Regards,
B
7
S
3
Posts: 8
Reputation: 646


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests