0 votes

i want to make a game that has multiple floorings; tiles, concrete, wood, carpet
and have different sounds on what i walk on.

Godot version 3.5.1
in Engine by (39 points)

1 Answer

0 votes

I haven't actually done it myself, so this is more of a stream-of-consciousness reply.

I would approach this by embedding the walking sound into the scene class that represents each flooring. Have a raycast emitted from the player downward towards the floor. When the raycast indicates a collision with the floor, get the collision object (which will be the floor's scene object) which will contain the walking sound to play, and play it.

by (375 points)
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.