What is the best way to get the exact time a room is created?
Is there a way to find the room start time?
Room class in Normcore provides a time property, but this represents the server time on the current frame, not the creation time of the room.RealtimeComponent that records the server time when it is first instantiated. This would give you a rough approximation of when the room was created, as RealtimeComponents are initialized when the room is connected.RoomCreationTime is a RealtimeComponent that records the server time in its Start method. You can then use the GetCreationTime method to retrieve this time later.RealtimeComponent is initialized.RoomRealtimeComponentRealtimeComponentRealtimeComponentRealtimeComponentsRoomCreationTimeStartGetCreationTimeusing Normal.Realtime;
public class RoomCreationTime : RealtimeComponent {
private double _creationTime;
private void Start() {
_creationTime = realtime.room.time;
}
public double GetCreationTime() {
return _creationTime;
}
}