Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Silicon Power on April 03, 2023, 09:57:58 PM
-
Hi I need to change shadow distance at the runtime is there any action to do this for me?
-
Hi.
I did a quick search and from what I understand you can't change it directly.
what might be possible is to setup different quality settings.
Then Set Quality Level (Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)) to change
-
Hi.
I did a quick search and from what I understand you can't change it directly.
what might be possible is to setup different quality settings.
Then Set Quality Level (Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)) to change
Thank you what about get quality? I need to get quality first
-
Wouldn’t that be it?
https://forum.unity.com/threads/change-max-shadow-distance-at-runtime.1325874/
-
Wouldn’t that be it?
https://forum.unity.com/threads/change-max-shadow-distance-at-runtime.1325874/
Hi thank you. Can you please make a playmaker action from this? I use default render pipleline
-
Thanks for the link.The shadow remains unchanged. While searching online for writing an essay draught since I don't know how to do it. I asked my friend and he told me to visit this site right here (https://writinguniverse.com/essay-draft/) writinguniverse.com/essay-draft that will instructs me on how to do it. This helps me to complete my essay assignment on the time and I will write my essay easily.
-
Wouldn’t that be it?
https://forum.unity.com/threads/change-max-shadow-distance-at-runtime.1325874/
Hi thank you. Can you please make a playmaker action from this? I use default render pipleline
Sure. Here you go:
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("QualitySettings")]
[Tooltip("Sets the Shadow Distance from the Project Quality Settings at runtime.")]
public class SetShadowDistance : FsmStateAction
{
[RequiredField]
[Tooltip("The Shadow Distance to set.")]
public FsmFloat shadowDistance;
[Tooltip("Repeat every frame while the state is active.")]
public bool everyFrame;
public override void Reset()
{
shadowDistance = 0f;
everyFrame = false;
}
public override void OnEnter()
{
DoSetShadowDistance();
if (!everyFrame)
{
Finish();
}
}
public override void OnUpdate()
{
DoSetShadowDistance();
}
public void DoSetShadowDistance()
{
QualitySettings.shadowDistance = shadowDistance.Value;
}
}
}
Action is also attached so just drag it into your project. I tested it in my project and seems to work fine. I also added a 'everyframe' bool option so you could tween it if needed over time.
Cheers!