I've made this thing so that when you're looking at yourself through a camera, a green line should be drawn to indicate where you are currently aiming at.
It works fine with the player's angle, but when it comes to the player's pitch it only goes to 45 degrees instead of straight up or straight down (90 degrees).
Centered view:
[spoiler]
[/spoiler]Looking straight up:
[spoiler]
[/spoiler]As you see in the second image the "line" won't go further than that.
To create the line I make it spawn things as small as 1x1 pixels in front of you.
Here's ACS my code:
Code: Select all
Bool CouldSpawn = True;
Int increment = -(sin(GetActorPitch(0)));
For(Int dist=2; dist<4097 && CouldSpawn == True; dist++)
{
increment += (increment / dist);
CouldSpawn = SetActorPosition(1400+PlayerNumber(), GetActorX(0) + cos(GetActorAngle(0)) * dist, GetActorY(0) + sin(GetActorAngle(0)) * dist, (34.0 + GetActorZ(0))+increment, False);
If(CouldSpawn == True)
{
Spawn("Pixel", GetActorX(0) + cos(GetActorAngle(0)) * dist, GetActorY(0) + sin(GetActorAngle(0)) * dist, (34.0 + GetActorZ(0))+increment, 1100+PlayerNumber(), GetActorAngle(0) >> 8);
}
}Code: Select all
ACTOR Pixel
{
Height 1
Radius 1
+NOGRAVITY
+NOBLOCKMAP
+CLIENTSIDEONLY
+FORCEXYBILLBOARD
States
{
Spawn:
PIXA A 2 Bright
Stop
}
}
ACTOR Checker
{
Height 1
Radius 1
+NOGRAVITY
+NOBLOCKMAP
+CLIENTSIDEONLY
+FORCEXYBILLBOARD
States
{
Spawn:
NULL A -1
Stop
}
}
[/spoiler]