Arrow pointing towards object outside screen.

Get help using Construct 2

Post » Fri Dec 07, 2012 4:09 pm

What I would like to have is to have an arrow on the side of the screen pointing towards an object when the object is not on screen. As to tell the player where the object is.

I've tried doing it with an inverted Is on-screen event and then compare the objects X position with the players X position and if it is lower I have an arrow on the left side of the screen appear until the object is on screen again.

I thought this might work until I realized, what if the object is below the player? That would mean there would be an arrow both on the left side of the screen and on the bottom of the screen.



so does anyone have any clever ideas how to go about doing this? Ideally I would like to only use one arrow and it should always point towards where the objkect is if it is not on screen.
B
4
Posts: 46
Reputation: 617

Post » Fri Dec 07, 2012 5:03 pm

Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Fri Dec 07, 2012 7:21 pm

Seems to work fine in your example. But when I try to use it my example the arrow that should be pointing towards the object only stays in the top left corner. :/

To make it easier to understand. The arrow stays in the top left corner and appears to be working correctly. Like pointing towards the object and all but it just doesnt stay at the edges like in your example.

Vitae2012-12-07 19:31:57
B
4
Posts: 46
Reputation: 617

Post » Fri Dec 07, 2012 8:02 pm

Your events all use ViewportTop when they should be the same as my example.
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Fri Dec 07, 2012 8:30 pm

Oh wow...
Guess if I feel stupid now. :P

Does this look right?

Also, I can add taht it is still doing the same thing as before. :P

Vitae2012-12-07 23:00:00
B
4
Posts: 46
Reputation: 617


Return to How do I....?

Who is online

Users browsing this forum: Scofano and 19 guests