Align projectiles to BSP or Terrain

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

theabyss

No One Here Gets Out Alive
Dec 3, 2005
1,669
9
38
East Coast
Hi there i am new to this forum.
I have a question about the Firemodes.

I got my mutator working to let the projectiles of my extended weapon
stick to bsp .

The question is: Is there a way to align the bottom of the projectile, so that
is always facing in the direction of the BSP?

Here is a picture of what i mean:

StickToBSP



ThanX for your Help/Hints!
btw i already searched at other forums and at wiki for an answere...
 

pospi

New Member
Jun 30, 2003
298
0
0
www.pospi.cjb.net
override the HitWall() function of the projectile as it has the vector (hitNormal) that points out from the surface of the wall passed into it. you can then use that to rotate the projectile how you want it.
 

theabyss

No One Here Gets Out Alive
Dec 3, 2005
1,669
9
38
East Coast
hmmm...something like this:

Code:
SetPhysics(PHYS_None);

        //Orient to surface
        myRot = rotator(HitNormal);
        myRot.Pitch -= 16384;
        SetRotation(myRot);

A guy at the buzz forums gave me that code....i will try that..
will let ya know if it works..

ThanX

TheAbyss
 

theabyss

No One Here Gets Out Alive
Dec 3, 2005
1,669
9
38
East Coast
I got it working !
Woohooo...took me a while.

Here is the code for those who are interested:

Code:
//=============== Stick to wall and face in cert. direct.

simulated function HitWall( vector HitNormal, actor HitWall )
{

   local rotator myRot;

          SetPhysics(PHYS_None);

        myRot = rotator(HitNormal);
        myRot.Pitch -= 16384;
        SetRotation(myRot);

        bLanded=true;
        Velocity=0*Velocity;
      
}

Now the projectile sticks to BSP or StaticMeshes and aligns
on its surface.
2 Links helped me to understand the whole thing:

WOD
Mutation

Thanx @ pospi for your Help
it gave me the hint in the right direction

Greetz

TheAbyss