Skip to content

BUG - Units not moving with hex #6

@janpeli

Description

@janpeli

If you move the camera and hexes start moving the Dwarf does not move with the hex.
Just add a check into the UnitView a check if the animation is playing.

void Update()
    {
        if (inMotion) 
        {
            this.transform.position = Vector3.SmoothDamp(this.transform.position, newPosition, ref currentVelocity, smoothTime);

            // TODO: Figure out the best way to determine the end of our animation
            if (Vector3.Distance(this.transform.position, newPosition) < 0.1f)
            {
                GameObject.FindObjectOfType<HexMap>().AnimationIsPlaying = false;
                inMotion = false;
            }
        }
        
    } 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions