How do I make an object follow a path after created..

Get help using Construct 2

Post » Mon Jul 28, 2014 12:39 am

Message: StrangeyD can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I had another thread created for a similar problem but still didn't get resolved, I can create the object and the path that disappears after the finger is taken off but when the object is created and is using bullet speed the object reacts weird and not as it should with thanks in the last thread I received help off of: TheDom & LittleStain and they gave me these capx which helped: https://dl.dropboxusercontent.com/u/421 ... 0trace.zip.

But I still cant get the path behavior to work once the object is moving using bullet speed.

I have used a lot of the same code in the above capx but changed it so that upon click the object is not created and the object is created upon layout start.

Any help would be appreciated!
B
5
S
2
Posts: 105
Reputation: 837

Post » Mon Jul 28, 2014 8:19 am

Just to be clear..
You want the object to move along the path while it is already moving?

At what time do you want the object to stop it's original direction and start following the path?
What happens if the player doesn't move his or her finger fast enough?
Should it be possible to change direction while following a path?

There are a lot more questions, but these should be the start..
I can see a lot of issues popping up if you aren't clear about what would happen if a player touches a moving object, without really creating a drawn path..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jul 28, 2014 10:25 pm

Thanks for the reply, I want an object to be created at the start of the layout and once its created I used bullet movement to set it off at an angle, then the player can put his finger over the object and draw a new path for it to follow, then once the player releases object it will start to follow the path.

The problem I have is I created the above and it all works fine until you go to touch the object while it is moving and the object acts in a weird manner because of the bullet movement, weird as in it makes the object travel backwards.

The object would follow the path or angle is was originally spawned at until the player interacts with the object to change its path, if the player doesn't interact with the object it will just continue on its original angle of motion.

it will be possible to change the objects path after it has been changed by the player.

Hope that helps answer the question.
B
5
S
2
Posts: 105
Reputation: 837

Post » Mon Jul 28, 2014 10:38 pm

The issue is that after the path has been drawn, the bullet isn't at the starting position of the path anymore, so you should create events in which you tell the bullet what to do..

Or you should only make it possible to create a path in the general direction the bullet is travelling..

Question remains.. What do you expect the bullet to do when selected?
Should it stop? Continue to fly but make a u-turn back to the path?
Following the path immediately will be a problem because the bullet will have flown past the path start the next tick..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jul 29, 2014 1:44 am

"Following the path immediately will be a problem because the bullet will have flown past the path start the next tick.."

Yes I think this is the problem, this is a kind of example to which I can explain what I am looking for:

Imagine a track with a car driving down the main straight then the car comes into view from the left side of layout with the bullet speed set to 35, the player then places their finger on the car to initiate the path drawing function and proceeds to draw a path for it to follow anywhere on the layout for it to follow.

I hope that gives you a kind of better picture of what im trying to achieve.

Again thank you for your patience and help with this, much appreciated.
B
5
S
2
Posts: 105
Reputation: 837

Post » Thu Jul 31, 2014 2:39 am

Any ideas?

I have taken a look at the other tutorials but none of them cover the object moving when the path is first created.
B
5
S
2
Posts: 105
Reputation: 837


Return to How do I....?

Who is online

Users browsing this forum: Instrex and 22 guests