Topic: Prevent player from pushing opponent

As you can see in video player1 can push player2 and also on boundary. How can I prevent this?
https://drive.google.com/file/d/1hEQUux … sp=sharing

Share

Thumbs up Thumbs down

Re: Prevent player from pushing opponent

You will need the source code to change that behavior.
Under ControlsScript.cs, look for function pushOpponentsAway
Now look for these segments and comment them (add // at the beginning of each line):

opControlsScript.worldTransform.Translate(new FPVector(.1 * -pushForce, 0, 0));

and

opControlsScript.worldTransform.Translate(new FPVector(.1 * pushForce, 0, 0));

I'll see if I can add an editor option for these in future updates.

Like UFE? Please rate and review us on the Asset Store!
Questions about the Forum? Check out our Karma FAQ.
Don't forget to check our discord channel.

3 (edited by anjumshehzad316 2021-03-24 05:52:39)

Re: Prevent player from pushing opponent

Fixing this issue creates another.
I'm working on a bonus stage where you have to destroy a car that stands still. If, I follow your instructions car will not be pushed but self applied forces on player mess things up and player gets stuck inside car mesh. I'm even checking for hit box collisions before adding force inside "AddForce" function.but if the self applied force is too much it doesn't work e.g wall launcher

 Fix64 pushForce = CollisionManager.TestCollision(controlScript.myHitBoxesScript.hitBoxes, controlScript.opControlsScript.HitBoxes.hitBoxes, false, false);

        if (pushForce <= 0 || UFE.gameMode != GameMode.BonusStage)
         //Apply force

How can I check collision by factoring in activeforces?

Share

Thumbs up Thumbs down