# How do I create custom movements

Get help using Construct 2

### » Mon Jun 09, 2014 5:58 am

Hi all,

I need to create two different types of custom movements for a game I am working on.
I don't know if it is necessary to use custom movements or there is a behavior that can make this to work.
Basically, I need to go from point A to point B.

B
133
S
52
G
25
Posts: 401
Reputation: 23,144

### » Wed Jun 11, 2014 11:37 pm

I was able to create the fist movement but not the second.

Any help?
B
133
S
52
G
25
Posts: 401
Reputation: 23,144

### » Wed Jun 11, 2014 11:45 pm

the second is trig.

Loop this
angle =+ 1
x = cos( angle ) *radius
y = sin( angle ) * radius

then tinker as needed.
B
94
S
18
G
9
Posts: 2,457
Reputation: 15,177

### » Thu Jun 12, 2014 6:22 pm

Your solution almost worked for me. However, I have some small problems:
1) How can I make the object to start the movement in the center of the layout?
2) The movement grows way to fast when I add 1 but too slow when I add 0.1. what should I do?

Here is what I am doing:
B
133
S
52
G
25
Posts: 401
Reputation: 23,144

### » Thu Jun 12, 2014 7:15 pm

If you want an object to be placed in the middle of a layout you can do this (see picture).

If 1 is too fast and 0.1 is too slow you might need to take a different approach than using "every tick".
If you make a global variable called "timer" and then add 1 to it every tick you can use that to change how often the calculations are triggered. So basically:

Every tick - Add 1 to "timer".

If "timer" = x (try different numbers to see what works for you) then set "timer" to 0 and also trigger the calculations once.

Hope that made sense.
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 41
Reputation: 762