Jump to content

Problem regarding to the Changing of Position


photo

Recommended Posts

private void CameraPosition(){

        vec3 targetPosition = cameraTarget.Position;
        vec3 camPosition = node.Position;
  
        if(Input.IsKeyPressed(Input.KEY.W)){
           Log.Message("Input Key is Presseds");
           camPosition = targetPosition;
           Log.Message("Camera Target Position. " + targetPosition + "/n");
           Log.Message("Camera Position. " + camPosition + "/n");
        }
        Log.Message("Camera Target Position. " + targetPosition + "/n");
        Log.Message("Camera Position. " + camPosition + "/n");
}

 

Link to comment
 if(Input.IsKeyPressed(Input.KEY.W)) {
  Log.Message("Input Key is Presseds");
  camPosition = targetPosition; // camPosition - it is local varaible. you need to apply position back to node
  node.Position = camPosition; // apply position
}

 

  • Like 1
Link to comment
×
×
  • Create New...