Home Artists Posts Import Register

Downloads

Content

This can be used to increase the height of any object in your worlds.

Create a new U# script.

Name it witha  fitting name


Attach the following script:

using UdonSharp;

using UnityEngine;

using VRC.SDKBase;

using VRC.Udon;

using UnityEngine.UI;


public class IncreaseH : UdonSharpBehaviour


{

    public Slider _slide;

    public Transform Target;


    private Vector3 initPosition;

    [UdonSynced] private float valSync = 0;


    void Start()

    {

        initPosition = Target.localPosition;

        valSync = _slide.value;

    }


    new void OnDeserialization()

    {

        modifyPosition();

    }


    public void OnSlideUpdate()

    {

        valSync = _slide.value;

        modifyPosition();

    }


    public void modifyPosition()

    {

        Target.localPosition = new Vector3(Target.localPosition.x, valSync, Target.localPosition.z);

    }

}


___________


I have also attached the script below

Add the script to a slider and drag in your target object to the Target field, Slider into the Slider field


On the slider component itself, Add a "OnSlideUpdate"


Done!


Comments

No comments found for this post.