- Home /
Transorm Position logging/ Excel connection
Hey guys,
I need an addition for the following script that is able to log the transform.position (x; y, z axis) of the created GameObjects and to save it in an excel sheet.
using UnityEngine;
public class KOS_Spawner : MonoBehaviour
{
private GameObject KOS;
private Vector3 position;
private void Start()
{
if (GetComponent<VRTK_ControllerEvents>() == null)
{
VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "KOS_Spawner", "VRTK_ControllerEvents", "the same"));
return;
}
GetComponent<VRTK_ControllerEvents>().TriggerPressed += new ControllerInteractionEventHandler(DoTriggerPressed);
KOS = GameObject.Find("KOS");
position = KOS.transform.position;
}
private void DoTriggerPressed(object sender, ControllerInteractionEventArgs e)
{
Invoke("CreateKOS", 0f);
}
private void CreateKOS()
{
Instantiate(KOS, position, Quaternion.identity);
}
}
Kind regards
Eric B.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612175144im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
JS Move object over time 1 Answer
Respawn question 2 Answers
Transform position not changing. 2 Answers