follow smoothly

Get help using Construct 2

Post » Wed Sep 24, 2014 5:42 am

@Yann Something is making it shoot to the top left of the screen :D Can I get some help here! I have no clue what I'm doing wrong. I figured it was something to do with one of the image points or something but I don't know!

When I take out this code
Image

it does stop going to the top left of the screen but it doesn't follow the character! :lol:
B
11
S
3
G
1
Posts: 109
Reputation: 1,954

Post » Wed Sep 24, 2014 7:24 am

@Apox Inc
I just opened the original capx and played it, everything looks fine. Did you change anything? What you are describing would mean that xTarget and yTarget are equal to 0
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Wed Sep 24, 2014 7:30 am

@Yann Is it cool if I just send you my capx that way you can look at it?
B
11
S
3
G
1
Posts: 109
Reputation: 1,954

Post » Wed Sep 24, 2014 8:06 am

Top left of the screen is position x=0,y=0

If you are using touch.x, touch.y and are not touching the screen this gives 0,0
I'm not sure but it could be when you are trying to reference something that doesn't exist the return is 0,0 too
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
53
S
16
G
8
Posts: 6,157
Reputation: 19,744

Post » Wed Sep 24, 2014 1:59 pm

LittleStain wrote:Top left of the screen is position x=0,y=0

If you are using touch.x, touch.y and are not touching the screen this gives 0,0
I'm not sure but it could be when you are trying to reference something that doesn't exist the return is 0,0 too


@LittleStain I think there is something that I am just looking over in the code itself. I can't figure it out though haha Once Yann replies again I can send him my capx and he can take a look at it.
B
11
S
3
G
1
Posts: 109
Reputation: 1,954

Post » Thu Sep 25, 2014 11:18 am

@Apox Inc
Nobody prevents you from posting your capx here (unless there's some forum limitation I'm not aware of)
I'm not the only one who can help (:
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Sep 25, 2014 5:43 pm

@Yann I know man but I got the source from you XD Speaking of your name is going in the credits for the assistance! :D
B
11
S
3
G
1
Posts: 109
Reputation: 1,954

Post » Sun Jun 21, 2015 10:28 am

Hello everyone in this old thread.

I cannot get my game to set Killers to follow player using pathfinding with more than one instance of the object Killer.
I made it work the first time but then I changed the code alittle and now I cannot for the world get it to work without lag on the 2nd level.

If i start the 2nd level directly from leveleditor it works without lag.
But if I start the game from the menu as it is suppose to. Complete the level 1 and start level 2. As soon as a Killer enters the screen on level 2 it starts lagging.
I dont know what the diffrence between starting the layout for level 2 directly and going through each level correctly is and I don't know why it lags. (Something to do with the Follow loop every 0.2 sec?)

Hope you can help me solve this.

Best Regards
Zeleene

Edit: I am not allowed to upload the URL to the capx file so I will send it in split sections:

https
://drive.google
.com/file/d/0Bwc4-dz1U65TckQ4cVF6R0dLOFk
/view?usp=sharing
B
3
Posts: 2
Reputation: 179

Post » Mon Jun 22, 2015 2:20 pm

Anyone know of a solution?
B
3
Posts: 2
Reputation: 179

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests