0 votes

Hi all,

I am making my 3D game using only Godot (nothing from blender) based on primitive types. I have been using MeshInstance of type plane for my floors but saw on youtube than plane are not recommended and will be deprecated.

Given this I decided to replace them with CubeMesh , however i am unable to have my textures displayed exactly as they were before (since the plane is now represented by 1 of cube faces). Can someone provide basic Godot tips of how to adjust the texture so it displays either full on 1 face of the cube or repeatedly on each face ?

I am no expert, and tried to play with the Geometry -> material override -> Uv1 and Uv2 scale properties without success (getting the texture displayed many times on same cube face).

Additional question: What is the difference and what are the pros / cons of:

Mesh -> Material 

or

Mesh -> Geometry Instance -> Material Override

Thx

asked May 18, 2019 in Engine by GameVisitor (834 points)

1 Answer

+1 vote

Try setting the UV1 to 3, 2, 1. You should get a result similar to this.

answered May 18, 2019 by Calinou (6,560 points)

Thx for ur feedback, it kind of worked, meaning in the editor i got the result i wanted.
However, I am randomly selecting a texture for the floor upon level starting and the ones selected are not being resized as i wanted (as per your solution).

I even tried adding the scale thru the code, however now, textures are displayed as simple black or white...

var newMat = SpatialMaterial.new()
newMat.albedo_texture = itex
newMat.flags_unshaded = true
newMat.uv1_scale = Vector3(3,2,1)

Any idea ?

PS: I am using Mesh -> Material in case it matters.

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.