Manual movement and rotation like a factory belt

Get help using Construct 2

Post » Fri Apr 12, 2013 7:12 am

Hey,

I'm trying to make an object move in a predetermined path, going in a straight line first, then rotating until it is completely inverted, then proceeding straight and finally rotating back to normal and continuing the loop.

I tried doing this with overlap checks, custom movement, and other things but none work perfectly and it almost always moves out of the intended path after a while.

I'm going for something like this. When the rod reaches the right edge, it collects a bubble, and when it reaches the left, the bubble bursts as it rotates back to normal.

Here's a crude reference pic.


Thanks! :)Fynnick2013-04-12 07:21:22
B
3
Posts: 12
Reputation: 499

Post » Fri Apr 12, 2013 9:03 am

What I think you need are objects on the end of the belt, when the blue object hits those then you would get the blue object to rotate.

My advice code wise would be to do this:

- If object is colliding with Turning Point
-- Stop object
-- Rotate object by 2 degrees
-- Once object is at the right angle, let it carry on moving again
B
10
S
2
G
4
Posts: 45
Reputation: 5,894

Post » Fri Apr 12, 2013 9:33 am

Okay I put together a little example of what I was talking about.
http://www.mediafire.com/?rck32ca114rmdc7

This of course doesn't solve the problem of having it turn around a particular point. One way I can think of getting around it is having one object on the ground and the other object in the air at a specific distance away, so you would rotate the object in the air, rather than the entire object itself.
B
10
S
2
G
4
Posts: 45
Reputation: 5,894

Post » Fri Apr 12, 2013 9:33 am

[QUOTE=AlexFili] What I think you need are objects on the end of the belt, when the blue object hits those then you would get the blue object to rotate.

My advice code wise would be to do this:

- If object is colliding with Turning Point
-- Stop object
-- Rotate object by 2 degrees
-- Once object is at the right angle, let it carry on moving again[/QUOTE]

I have it working in one direction using rotate x towards y degrees. However, it just encounters my 2nd sensor object and then just goes ahead without rotating.

https://www.dropbox.com/sh/py6arnkalgcgdvb/3jnInlg6fR
B
3
Posts: 12
Reputation: 499

Post » Fri Apr 12, 2013 10:02 am

Well after working on it a bit more, I solved it with instance variables n some experimenting.

Thanks a bunch for the 'Stop' suggestion tho! :) That's what got my thing started :P

https://www.dropbox.com/s/v1u60tjiljnqqrk/belt%20bubble%20holder.capx
B
3
Posts: 12
Reputation: 499


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 18 guests