Run/Play project is grey, despite objects rendering in cinematic preview

Godot Version

4.4

Question

Hello all! I am working on my first Godot project, and have ran into a snag. I currently have a very basic 3D Enviornment with a cup, a rectangle, and some particles. I want the cup and rectangle to be directly in front of the player. They appear as intended in the 3D menu, under cinematic preview, from a 3D camera perspective. The camera is enabled.

However, when I run the project using the play button, the pop up window just displays a blank grey screen. I do not see the objects as intended in the cinematic preview. If I override the ingame camera in the run/popup window, I see a the cup, but from a different angle than the cinematic preview (it is closer, and cut off at the top)

I have some screenshots of the scene tree, the 3D menu with the cinematic preview, and the pop up window.

Could this be an issue with a script overriding the camera perspective in the preview? It’s worth noting that I am using a barebones Chromebook, and am running everything in compatibility mode with a small resolution, so I’m wondering if this could be a rendering issue as well.




Any assistance is much appreciated!

bump bump

Do you have any lighting? The preview will cheerfully show you a lit scene when the runtime version has no lights…

Maybe (if you don’t have one) add an environment to your Camera3D and set an ambient light…

If it’s not that, do your scripts do anything with the camera or positions?

Is your player Node falling through 3D space when you boot it up? What are you doing in your scripts?

Does it work any better if your script is fixed and does not error-freeze immediately?

Added a debug to print player location, doesn’t seem to be the case. Player is node3d object without a rigid body, don’t think it’s falling

Have a directional light object with light and sky enabled.

Attached are screenshots showing the position/rotation of the various objects in the inspector. Essentially I have a cup, a rectangle(Pitcher) and the directional light/ camera objects. Right now, I want to be able to just see the objects from the intended perspective, not really worrying about the particles/manipulation.

I have a script for the player node, which is below. I’m primarily trying to control the mouse movement / FOV, I’m wondering if that is conflicting with what I am seeing in the 3D /cinematic preview. Haven’t worked with scripts before so am a bit over my head.

Player script:

extends Node3D

var mouse_sensitivity = 0.1
var mouse_captured = true

func _ready():
print("Camera path: ", $Camera3D.get_path())
print("Pitcher path: ", $Pitcher.get_path())
print("Cup path: ", $cup.get_path())

# Reset rotations
$Camera3D.rotation = Vector3.ZERO
rotation = Vector3.ZERO

$Camera3D.current = true
print("Is camera current? ", $Camera3D.current)

Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)

func _input(event):
if event is InputEventMouseMotion and mouse_captured:
rotate_y(deg_to_rad(-event.relative.x * mouse_sensitivity))
$Camera3D.rotate_x(deg_to_rad(-event.relative.y * mouse_sensitivity))
$Camera3D.rotation.x = clamp($Camera3D.rotation.x, deg_to_rad(-45), deg_to_rad(20))

if event is InputEventKey and event.keycode == KEY_ESCAPE:
	mouse_captured = !mouse_captured
	Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED if mouse_captured else Input.MOUSE_MODE_VISIBLE)

func _process(delta):
# Debug position logging
print("Player Y position: ", global_transform.origin.y)


Rectangle position in inspector


Cup position in inspector

Was just able to run some 3D tutorial demos, like this rigidbody3d: RigidBody Character 3D

So don’t think it’s a compatibility/sys requirements rendering issue. Gonna get rid of the directional light and add a world Enviornment instead to see if that does anything .