Skip to content

Example 11:No Path line has been shown #5

@Simon1059770342

Description

@Simon1059770342

Hi Nik! When I accessed index.html from the example 11 on my phone with Chrome, No Path line has been shown even I called showPathLines() without debugging as follow:
`newPath(pt){
const player = this.object;

    if (this.pathfinder===undefined){
        this.calculatedPath = [ pt.clone() ];
        //Calculate target direction
        this.setTargetDirection();
        this.action = 'walk';
        return;
    }
    
	//console.log(`New path to ${pt.x.toFixed(1)}, ${pt.y.toFixed(2)}, ${pt.z.toFixed(2)}`);	

	const targetGroup = this.pathfinder.getGroup(this.ZONE, pt);
	const closestTargetNode = this.pathfinder.getClosestNode(pt, this.ZONE, targetGroup);
	
	// Calculate a path to the target and store it
	this.calculatedPath = this.pathfinder.findPath(player.position, pt, this.ZONE, this.navMeshGroup);

	const self = this;
	
	if (this.calculatedPath && this.calculatedPath.length) {
		this.action = 'walk';
		
		const pt = this.calculatedPath[0].clone();
		this.setTargetDirection()
		
		if (!this.npc){
			this.showPathLines();
		}
	} else {
		this.action = 'idle';
		`
		THX for your HELP!

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