Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currently struggling to figure out how to make units move around each other and not get stuck #1

Open
valkyrienyanko opened this issue May 2, 2023 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@valkyrienyanko
Copy link
Contributor

A discussion of this has been started on Godot discord and a link to the thread can be found here.

Relevant code

GodotRTS/Scripts/Unit.cs

Lines 22 to 40 in 308af2e

area.BodyEntered += body =>
{
if (body is Unit unit)
{
if (toSkip.Contains(unit))
{
toSkip.Remove(unit);
return;
}
var dirA = Direction;
var dirB = unit.Direction;
Direction = dirB.Orthogonal();
unit.Direction = -dirA.Orthogonal();
unit.toSkip.Add(this);
}
};

2023-05-02.13-15-21.mp4
@valkyrienyanko valkyrienyanko added good first issue Good for newcomers help wanted Extra attention is needed labels May 2, 2023
@valkyrienyanko
Copy link
Contributor Author

I didn't realize I already made an issue about this when I was making this video so... I'll just post this here :)

GithubIssueVideo.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant