Need help with ground texture for a delimited football field

Godot Version

4.6

Question

Hi all

I’ve got quite a lot of experience in the programming of business applications and data manipulation but I’m a newbie in 3D games development and especially in Godot.

I have started building a football management game for fun on my spare time.

I’m quite confortable with the creation of the UI screens and the logic for the club management part but since I want to show the games in 3D, I’ve also started building a football match engine (call me crazy…).

Programming the AI match engine will be challenging but should be achievable. What I’m struggling with is the 3D part since I’m not used to most of the concepts involved. I usually overcome difficulties by reading the Godot manual and tutorials or by lurking around this forum.

So far I have an animated player (using Mixamo animations) that can move around the pitch and jump but I’m still at pain building the overall 3D environnement. Right now I’m having a real nightmare setting up correctly the football field and its texture(s).

What type of node should I use for the pitch and it’s texture ? I’m currently using a StaticBody3D with a MeshInstance3d.

I loaded a picture of a whole football pitch, complete with lines, central circle and so on, as material for the MeshIntance3D but I can’t seem able to fit it correctly with the StaticBody3D and MeshInstance3d.

The picture is a .png file whose size is exactly one tenth of their dimensions. I played with the Material and MaterialOverride properties with very little success : either it looks like the width/lenght ratio is incorrect or it duplicates the image a number of times to fill the whole surface.

What do you recommend in this case ? Should I use a small chunk of grass and let it repeat over the whole surface ? And then add the lines using another node ?

Or is it correct to apply the whole picture to the MeshInstance3D but using specific settings I didn’t try ?

Thanks in advance for your help.

Lucas

Depends on how your mesh is set up, transferring a 2D image onto the many faces of a 3D mesh involves “UV” coordinates. Maybe your mesh has improper UVs for what you are trying to achieve. For the Ground I think Godot’s built in Plane mesh or Quad mesh should have basic 1 face to 1 image UVs, you shouldn’t need to use the StandardMaterial3D’s uv_offset or uv_scale, or at least not much, assuming your ground plane is the correct size.

Thanks for the quick answer. I’ll try the plane mesh, seems logical for a flat ground. I think I was a bit misled by the 3D tutorial on this occasion.