Topic: Stage Centre

Ive been messing around with z-axis movement, which means I have to limit the players differently than vanilla UFE.

I want to give them a circular movement (ring) from the stage centre.

Vector3 stageCentre = Vector3.zero;
    float radius = UFE.config.selectedStage.ringRadius;

  float dst = Vector3.Distance(stageCentre, transform.position);
        if (dst > radius)
        {
            Vector3 vect = stageCentre - transform.position;
            vect = vect.normalized;
            vect *= (dst - radius);
            transform.position += vect;
        }

This is okay-ishg, but Im not sure that it's quite right. Is Vector3.Zero the centre of the stage, also, can I access the starting positions of the players from PhysicsScript.cs?

subtracting the tow starting Vectors would give me an ideal centre point to limit their movement from.

Share

Thumbs up Thumbs down

Re: Stage Centre

I think it depends the stage (http://www.ufe3d.com/doku.php/global:stages).

You can set different left/right boundaries, so the centre could be considered different if you have different left/right boundaries.

At least, that's my understanding.  This also doesn't take into consideration 3D movement.

BTW, will you have walls or ring outs in your game?

Share

Thumbs up Thumbs down

Re: Stage Centre

I'm not planning on ringouts. Ill have a outer wall (background scenery) that limits the camera, and a smaller inner area that the players can move around in.
The current boundaries wouldn't work in a z-axis system. (I think you could add two more for a square arena).
I've replaced the left/right boundaries with a float for the radius. The code above calculates a circle from that. The players are limited to that.

I just want to make sure it's nice and robust if I can.

Share

Thumbs up Thumbs down

Re: Stage Centre

Ah, sorry I didn't realise you're modifying the Stage Options.  I think in theory what you have should work.  I assume you've tested, how does it feel?

Also, answering question from first post:  Round Options has the initial spawn locations for p1 and p2.

Share

Thumbs up Thumbs down