0 votes

I can change the size of the mesh by doing this in GDScript:

$"../World/Ocean".get_mesh().size = Vector2(init_w.value, init_h.value)

How do you do this in C#?
There is no GetMesh() function or anything similar

 GetNode("World/Ocean").GetMesh() //Doesn't exist

But I see it in the docs, is this function not working?

Bonus: is there a place where I can find what a C#'s GDScript equivalent is?

in Engine by (14 points)

1 Answer

0 votes

The page you linked is for version 3.0.3. If you look at the more up-to-date docs (3.2), you'll see that the GetMesh() method has been deprecated in favor of a Mesh property.

https://godotsharp.net/api/3.2.0/Godot.MeshInstance/

by (10,856 points)

Thanks for your answer but I'm having trouble still.

(MeshInstance)GetNode("../World/Ocean").Mesh 

Says 'Node' does not contain a definition for 'Mesh' even though I am casting it. How do you do this?

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 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 webmaster@godotengine.org with your username.