Offscreen Tracking
Blitz3D Forums/Blitz3D Beginners Area/Offscreen Tracking
| ||
Hi guys, I'm new here and this is my first post! :-D I'm trying to create a simple soccer game. The camera is focused on the location of the ball, and sometimes it gets to a spot where there are no user-controlled players are. So I need a system that tracks where the user-controlled players are offscreen. I'm sure you guys have some idea about this, you know those little arrows at the edge of the screen pointing the relative position of player? I have no idea how to do this, and CameraProject seems to only work for objects onscreen. Any help? Thanks a lot in advance! |
| ||
You can use some simple if < and > commands. This is English programming below: if player is behind camera by 1, put and arrow here if player is behind camera by 2, put and arrow here ... AJ00200 |
| ||
you could have an arrow that points at the player... basic example |
| ||
Hey thanks a lot guys! You're idea was great Nate, I'll try it out! |
| ||
ok thanks... I know what you were originally trying to do but I cant figure that out either :p but many popular games use an arrow that points at the player as well so im sure it will be fine |
| ||
Your going to need to do some basic Trig. Use the atan() function to find the angle. Atan(distance away from screen edge X /distance away Y) Add that to the sides angle (top=0, right=90, bottom=180, left=270) and that will give you the angle. Can anyone explain this better?? |
| ||
Maybee its normal tan() |
| ||
Didn't the 'camera' in 'Kick off' just follow the player closest to the ball? |