Page MenuHomeFeedback Tracker

setVectorDir/setVectorUp/setVectorDirAndUp also change the velocity vector
New, NormalPublic

Description

This is a sample code that launches the player up into the air towards North (with an azimuth of 45 degrees) and rotates him:

player allowDamage false; 
onEachFrame {
 if (isGamePaused) exitWith {}; 
 if (isTouchingGround player) exitWith {player setVelocity [0,100,100]};  
 player setVectorDir ([vectorDirVisual player, 1] call BIS_fnc_rotateVector2D); 
 hintSilent str ([0,0,0] getDir velocity player) 
}

setDir works correctly:

player allowDamage false; 
onEachFrame {
	if (isGamePaused) exitWith {}; 
	if (isTouchingGround player) exitWith {player setVelocity [0,100,100]};  
	player setDir (getDirVisual player - 1);  
	hintSilent str ([0,0,0] getDir velocity player) 
}

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Category
Scripting

Event Timeline

Leopard20 created this task.Apr 4 2021, 8:08 PM
Leopard20 updated the task description. (Show Details)Apr 4 2021, 8:18 PM
Leopard20 updated the task description. (Show Details)Apr 4 2021, 8:22 PM
Leopard20 updated the task description. (Show Details)
Leopard20 updated the task description. (Show Details)Apr 4 2021, 8:29 PM