UE2 - UT2kX bouncing Mover

  • 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.

brick

New Member
Sep 5, 2011
15
0
0
France
www.insidexiii.eu
Hello,
i'd like to create a special mover that has an additionnal feature : a bouncing movement (following the vertical axis), additionnaly to the interpolated movement between keyframes.
bal01.gif

like this pica, but without velocity loss (= constant max height bouncing)

How can i code this ? i'm gonna subclass Mover, but i'm wondering wether i add some lines in the InterpolateTo function, or wether i add a Event Tick() which adds the bouncing feature (parabolic thingy) to the actual location.
Depending on the method, it should bounce at its initial state, or not.

Does anyone have an idea ? by advance, thanks a lot.
_______________________________________________________

Solving with XIIIEd. Is there a possibility to attach a mover that has only this bouncing motion (no X nor Y velocity)
to a mover that have normal key frames, so the result is a combination of all ?
 
Last edited:

brick

New Member
Sep 5, 2011
15
0
0
France
www.insidexiii.eu
Indeed. I need the usual Mover properties however (trigered by, bumped by..).
I've made a try. I added an event Tick() with my physics properties in, and i deal with a Mover with only one key position/location. Maybe i have to override the InterpolateTo() function with an empty one and 'im done :)
 

brick

New Member
Sep 5, 2011
15
0
0
France
www.insidexiii.eu
i'd like now to make this working online.
The problem is that i shouldn't replicate all the instances of the movement every tick i guess ...(I connected as client and the ball messed up every where instead of following its way kindly:D)
I noticed that a Mover actor replicates only the intermediate locations/rotations, the interpolation working client-side (simulated functions).
I noticed also that the final locations/rotations are updated if they are somehow different from what they should be.
My code looks like a mover baseclass, i just added a Event Tick(), so i can stand on while moving. The placed actor has only one key-frame :
Code:
event Tick ( float DeltaTime )
{ 

 if ( bBouncingMover )
	{
				DT = DeltaTime*fBouncingAcc + DT;
				DTadd += DeltaTime;
						
				if ( DT >= fBouncingheight )
					{ 
						DT=0;
						v.Z = BasePos.Z;
						DTZ = 0;
					}
					
				if ( DTadd > 65535 ) DTadd = 0;
					
				DTX = sin ( DTadd * XaxisSinusMulFactor ) * XaxisSinusMovVelocity;
				DTY = sin ( DTadd * YaxisSinusMulFactor ) * YaxisSinusMovVelocity;
				DTZ = ( 4 * DT / fBouncingheight ) * ( fBouncingheight - DT );
				
				v = Self.Location;
				v.X += DTX - OldDTX;
				v.Y += DTY - OldDTY;
				v.Z += DTZ - OldDTZ;
				Self.SetLocation( v ); 
				
				OldDTX = DTX;
				OldDTY = DTY;
				OldDTZ = DTZ;
				
	}
}
How could I operate ? by advance thanks for your help guys :)
 
Last edited: