Scripting 8Direction behavior

0 favourites
  • 2 posts
  • According to the documentation, the vectorY property of 8Direction should be settable, however, it does not seem to have an effect when done through javascript.

    	console.log("VERTICAL");
    				var lineUP = this.runtime.objects.Laser.createInstance("PlayBoard", thisPiece.x, thisPiece.y);
    				
    				lineUP.behaviors["8Direction"].vectorY = 100;
    				console.log(lineUP.behaviors["8Direction"].vectorY);
    				console.log("X:" + lineUP.behaviors["8Direction"].vectorX + " Y:" + lineUP.behaviors["8Direction"].vectorY);
    				
    
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Okay, So one thing I did wrong was I set the Max Speed as 0. However, when I change VectorY through 8speed it seems to be affecting VectorX instead. Any thoughts?

    	console.log("VERTICAL");
    	var lineUP = this.runtime.objects.Laser.createInstance("PlayBoard", thisPiece.x, thisPiece.y);
    	lineUP.behaviors["8Direction"].vectorX = 0;
    	lineUP.behaviors["8Direction"].vectorY = 100;
    	console.log("X:" + lineUP.behaviors["8Direction"].vectorX + " Y:" + lineUP.behaviors["8Direction"].vectorY);
    

    Console Output

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)