Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Bainto on June 25, 2018, 08:50:58 AM

Title: Terrain Detection (Solved)
Post by: Bainto on June 25, 2018, 08:50:58 AM
Is there anyway to create a terrain detection script for a char, where instead of playing the basic clopping of the prefab it plays sounds based on what terrain the char is on?
Title: Re: Terrain Detection
Post by: verybinary on June 26, 2018, 10:50:06 AM
when character is grounded, raycast down, compare the name of the hit object with events and send to the event that plays the correct sound.
Title: Re: Terrain Detection
Post by: djaydino on June 26, 2018, 07:22:56 PM
Hi.
You can also compare the material if materials are changing during run time on the object.
This way you can dynamically change the effects on the same object.
Title: Re: Terrain Detection
Post by: Bainto on June 26, 2018, 10:09:28 PM
I have probably 5 different terrains or so that the char will play on is there anyway id be able to have a bit more detail as im really new XD ty for the help and ill attempt to figure it out in the meantime with the thought of using raycasting.
Title: Re: Terrain Detection
Post by: Bainto on June 29, 2018, 05:17:22 PM
and.... im lost lol
Title: Re: Terrain Detection
Post by: djaydino on June 30, 2018, 12:38:25 PM
Hi. do you understand how  raycast works?

with the raycast you need to detect the ground object, then you can get the name/layer/tag/material and so on from that object.

Then you can use that information to determine what terrain you are on.

Here is one of my older videos about raycast :

Title: Re: Terrain Detection
Post by: Bainto on July 01, 2018, 05:00:24 AM
ty ill try this in the am :D