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

NPCs float in the air when using VSE waypoint #2126

Open
umdreamer opened this issue Jan 27, 2023 · 1 comment
Open

NPCs float in the air when using VSE waypoint #2126

umdreamer opened this issue Jan 27, 2023 · 1 comment

Comments

@umdreamer
Copy link

The NPC gets through the house wall and floats in the air until it gets down the ground. I have add NPCWaypointBehaviour.cs at line 101 to add rb.useGravity = true to get Gravity, but it doesn't work. The waypoints are from ground then to the house roof, and then to the ground. It looks that the NPC just follow the line between two waypoints ignoring any obstacles in on the way.

Any helps?

private void InitNPC()
    {
        Debug.Assert(LaneData != null);
        rb.isKinematic = false;
        rb.useGravity = true;
        controller.MainCollider.isTrigger = true;

image

@YuqiHuai
Copy link

I have some information that might help,

  1. Looks like you are trying to make sure the vehicle is on the ground. I am not familiar with useGravity, but I know how to set a waypoint that is on the ground by using raycast
    state = lgsvl.AgentState()
    state.transform = transform
    hit = sim.raycast(state.position, lgsvl.Vector(0, -1, 0), layer_mask)
    state.transform.position = hit.point
    return state
  1. No collision effects with NPC vehicle controlled by waypoints following #1802 this issue might be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants