0 votes

Hello everyone,
When encoding this tape:
var newplatform = sceneplatform.instance() as StaticBody2D

an error appears:

invalid.call. nonexistent function "instance" in base"nil"

how to fix the error??

Godot version Godot version 3.4.4
in Engine by (12 points)

1 Answer

+2 votes

This error is telling you that the variable you're calling instance() on is null. Where are you setting the value of scene_platform?

by (22,071 points)

i drag the tscn scene into the field:
Script Variables:
scene_platform [nul]

it is preserved, but the value
equal to [null]

yes, I have a saved tscn scene, and no, it is not instantiated anywhere else
after restarting the game, the same problem appears and the field-Script Variables:
scene_platform- becomes empty

I feel like I'm missing something in your description. Words are failing us here.

If you zip up your project and send it to me I'd be happy to look at it and see what's going on.

can i send you the whole project file to your email? I'm not sure if it's possible to submit it on this site

That or you can post it on a filesharing site.

It's chris at kidscancode.org

I sent you the zip file of the project by email, if you find the problem, please write back

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.