Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started 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?
-
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.
-
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.
-
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.
-
and.... im lost lol
-
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 :
-
ty ill try this in the am :D