Skip to content

Commit 3d9495a

Browse files
authored
Merge pull request #3 from thearst3rd/globalposition
Print global position rather than local position
2 parents 3081df0 + 165cdb0 commit 3d9495a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using UnityEngine;
88
using Harmony;
99

10-
[assembly: MelonInfo(typeof(SuperliminalPracticeMod.Main), "Superliminal Practice Mod", "0.4.1", "Micrologist#2351")]
10+
[assembly: MelonInfo(typeof(SuperliminalPracticeMod.Main), "Superliminal Practice Mod", "0.4.2", "Micrologist#2351")]
1111
[assembly: MelonGame("PillowCastle", "Superliminal")]
1212
[assembly: MelonGame("PillowCastle", "SuperliminalSteam")]
1313
[assembly: MelonGame("PillowCastle", "SuperliminalGOG")]

PracticeModManager.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class PracticeModManager : MonoBehaviour
2020
public Text grabbedObjectText;
2121
public PauseMenu pauseMenu;
2222
public MouseLook mouseLook;
23+
public CharacterController characterController;
2324

2425
Vector3 storedPosition;
2526
Quaternion storedCapsuleRotation;
@@ -99,6 +100,7 @@ void Update()
99100
{
100101
player = GameManager.GM.player;
101102
playerMotor = player.GetComponent<CharacterMotor>();
103+
characterController = playerMotor.GetComponent<CharacterController>();
102104
playerCamera = player.GetComponentInChildren<Camera>();
103105
mouseLook = playerCamera.GetComponent<MouseLook>();
104106
resizeScript = playerCamera.GetComponent<ResizeScript>();
@@ -296,9 +298,9 @@ Text NewGrabbedObjectText()
296298

297299
string GetPlayerTextString()
298300
{
299-
Vector3 position = playerMotor.transform.localPosition;
300-
Vector3 velocity = playerMotor.GetComponent<CharacterController>().velocity;
301-
Vector3 rotation = playerMotor.transform.localRotation.eulerAngles;
301+
Vector3 position = playerMotor.transform.position;
302+
Vector3 velocity = characterController.velocity;
303+
Vector3 rotation = playerMotor.transform.rotation.eulerAngles;
302304
float scale = playerMotor.transform.localScale.x;
303305
string dynamicInfo = "";
304306

0 commit comments

Comments
 (0)