How do I move a locked object to a pre-determined position?

Get help using Construct 2

Post » Mon May 25, 2015 11:18 pm

Hello C2 Gamemakers! :D

I would like to how to make a object controlled by the player (player character) to be automatically moved (but not teleported) to an X position and Y pre-determined after an event that locks the control of this object? I tried a number of ways, but it still fails.

Once again I thank the attention and participation of the C2 community.
B
39
S
9
G
3
Posts: 261
Reputation: 4,367

Post » Tue May 26, 2015 6:09 am

Have you tried the MoveTo behavior?
Maybe that is what you want?

A list of all the plugins are here
As of today, it is the first one listed.


https://www.scirra.com/forum/c2-plugins-and-behaviors-list_t65170
B
36
S
10
G
4
Posts: 250
Reputation: 7,963

Post » Tue May 26, 2015 9:46 am

Thanks for the tip, @producermark11. :D

I have not tried, because generally I prefer to use the native capabilities of C2 instead of plugins. It is true that plugins can cause bugs to the game?
B
39
S
9
G
3
Posts: 261
Reputation: 4,367

Post » Tue May 26, 2015 10:52 am

Maybe some plugins can cause some problems, but the MoveTo has never given me any problems.
Try it.
B
36
S
10
G
4
Posts: 250
Reputation: 7,963

Post » Tue May 26, 2015 11:16 am

MoveTo is perfect I been using for sometime. I even written C2 tutorial as well check it out

https://www.scirra.com/tutorials/1298/snakes-ladders
B
257
S
42
G
15
Posts: 1,992
Reputation: 41,435

Post » Tue May 26, 2015 11:42 am

Thanks for your collaboration, @producermark11 and @Lordshiva1948.

If you two say that this plugin work well, I'll use it. ^^

PS.: Now I'm using it and everything is working perfectly. ;)
B
39
S
9
G
3
Posts: 261
Reputation: 4,367

Post » Tue May 26, 2015 11:56 am

you can also use moveforward or moveatangle function from the object setting a boolean on the object, when boolean is true, will act as an everytick condition and then move at the angle you give, you wold have to calculate the angle(obj.x,obj.y,destination.x,destination.y) and rotate the object towards the same angle, by using set angle or rotate toward angle and use the angle(obj.x,obj.y,destination.x,destination.y) to give a destination. that's if you don't want to use any custom plugins, and you don't care of adding a few events
B
78
S
23
G
69
Posts: 1,354
Reputation: 44,027

Post » Tue May 26, 2015 3:03 pm

gamecorpstudio wrote:you can also use moveforward or moveatangle function from the object setting a boolean on the object, when boolean is true, will act as an everytick condition and then move at the angle you give, you wold have to calculate the angle(obj.x,obj.y,destination.x,destination.y) and rotate the object towards the same angle, by using set angle or rotate toward angle and use the angle(obj.x,obj.y,destination.x,destination.y) to give a destination. that's if you don't want to use any custom plugins, and you don't care of adding a few events


Thanks for your help, @gamecorpstudio. :D

I tried unsuccessfully something similar before, but today I will try to implement your suggestions and give a feedback here.
B
39
S
9
G
3
Posts: 261
Reputation: 4,367

Post » Tue May 26, 2015 3:07 pm

I think MoveTo a essential plugin and I think Scirra should make it a native behavior in future versions of Construct, to further optimize the game development time.

What do you think this, veteran developers?
B
39
S
9
G
3
Posts: 261
Reputation: 4,367

Post » Tue May 26, 2015 3:19 pm

I think MoveTo a essential plugin and I think Scirra should make it a native behavior in future versions of Construct, to further optimize the game development time.

What do you think this, veteran developers?
I totally agree
@Ashley :D
B
36
S
10
G
4
Posts: 250
Reputation: 7,963

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests