PDA

View Full Version : [Solved] Quick question Trace and Level



Saishy
06-20-2010, 06:23 PM
I'm doing a short trace to check if my pawn can perform a wall jump.



function bool DoWallJump( bool bUpdating )
{
local Vector HitLocation, HitNormal, End, Start;
local Actor HitActor;
Start = Location + (Vector(Rotation) * GetCollisionRadius());
End = Start + (Vector(Rotation) * 50);
HitActor = Trace(HitLocation, HitNormal, End, Start, false,);
/*if (HitActor == Level)
{
`Log("Imma WallJumpin");
}*/
//`Log(HitActor);
}


But the compiler don't accept "Level" in the if, but the Trace function says it can return "Level"...

D:

Edit: And the code is probably wrong too, cos this:



local Vector HitLocation, HitNormal, End, Start;
local Actor HitActor;
Start = Location + (Vector(Rotation) * GetCollisionRadius());
End = Start + Vector(Rotation) * 50;
HitActor = Trace(HitLocation, HitNormal, End, Start, false,);
`Log(HitActor);


Give me a warning, see the attachments.

Demestotenes
06-20-2010, 06:32 PM
Level?
maybe you want to use WorldInfo instead?

Saishy
06-20-2010, 06:38 PM
Level?
maybe you want to use WorldInfo instead?
Dunno, now I need the function to not crash :2

Blade[UG]
06-20-2010, 07:18 PM
Your error means that your function is declared to return a bool, but it's not returning anything.

In UE3, it's WorldInfo not LevelInfo.

Saishy
06-20-2010, 07:30 PM
;27417356']Your error means that your function is declared to return a bool, but it's not returning anything.

In UE3, it's WorldInfo not LevelInfo.
Oh damn, Thanks for the answer.

I can't get used to "function bool MyFunc()" instead of "bool function MyFunc()"
I keep missing the return.

Thanks again!