Chris
Chris

Reputation: 19

Is it possible to play your unity game in scene mode?

Hi I'm working on a simple 2D unity game and it would be so much easier to figure out problems if I could play my game in scene mode so that I could check on every object's values as I go. Is it at all possible to play your game in scene mode?

Upvotes: 1

Views: 1925

Answers (2)

CT pax
CT pax

Reputation: 1

You can read Inputs while being in a custom editor with for example:

if(Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.W) {...}

You can read all your wanted inputs and pass it on to your default input scripts. You could make whole games in just the inspector window or whereever you want, but if you should is another question...

Upvotes: 0

Mahdad Baghani
Mahdad Baghani

Reputation: 778

That is not possible, as of now, in the Unity engine. You would need to handle it yourself. Take the Unity's Cinemachine package as an example. You can tweak the values of a cinemachine virtual camera in-game and store the values as you tweak them if you check the "Save during play". The package is designed in a way that it preserves its state, so when you stop playing, it doesn't lose the changes you made in play mode. Moreover, Cinemachine gives you gizmos that you can tweak the values through the game viewport, not only the inspector.

You would need to do such things for your game so when you start playing, you can, for example, click the gizmos on a puzzle object and change where it sits in the scene, and when you stop playing, the tweaked position would be preserved.

Upvotes: 1

Related Questions