Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

[ad_1]

Transient Description: I’ve a RB based mostly character controller that I need to transfer together with my Practice platform (non physics based mostly) when the participant steps on it.

enter image description here

Primary Downside
I handle to make the participant comply with the platform, however I even have a digital camera jitter downside that I can not resolve with out breaking participant comply with the Practice platform logic.

Video displaying the jitter.

Necessary: I am not getting any jitter when solely transferring the digital camera

Necessary: I am not getting any jitter when solely transferring the Character with out transferring the digital camera

this is applicable to each when the participant is on a transferring platform, or off the platform

https://www.youtube.com/watch?v=9M4dt00dEes

My Digital camera Implementation

For dealing with the digital camera I am utilizing Cinemachine, alongside a CameraHolder which is a separate gameobject from the participant.

I am setting the remodel of the cameraHolder Gameobject to the gamers place in late Replace

personal void LateUpdate()
{
    remodel.place = cameraPosition.place;
}

enter image description here

The Headbob Offset gameobject is a baby within the cameraHolder with none motion.

Participant Controller Motion

I am utilizing this code in FixedUpdate to deal with my participant motion

    personal void HandleMovement()
{
    //previous enter system
    //float horizontal = Enter.GetAxis("Horizontal");
    //float vertical = Enter.GetAxis("Vertical");
    //Vector2 movementDir = new Vector2(horizontal, vertical).normalized;

    //New enter system
    movementDir = GameInput.occasion.GetMovementVectorNormalised();
    Vector3 currentVelocity = rb.velocity;
    Vector3 targetVelocity = new Vector3(movementDir.x, 0, movementDir.y);
    targetVelocity *= pace;

    targetVelocity = remodel.TransformDirection(targetVelocity);

    Vector3 velocityChange = targetVelocity - currentVelocity;
    velocityChange = new Vector3(velocityChange.x, 0, velocityChange.z);

    Vector3.ClampMagnitude(velocityChange, maxForce);

    rb.AddForce(velocityChange, ForceMode.VelocityChange);
}

RB interpolation is about to Interpolate

Practice Platform Motion Script

personal void FixedUpdate() 
{
remodel.place += remodel.ahead * currentSpeed * Time.deltaTime;
}

Necessary I am utilizing FixedUpdate, however my practice platform has no RB on it, I am utilizing FixedUpdate, as a result of in any other case my participant does not comply with the practice place change.

What I’ve Tried thus far

1. Lerping Digital camera Place

As an alternative of setting the digital camera place to the cameraHolder, I attempted lerping. It solved the general jitter within the recreation, however my entire practice platform turned jiterry when transferring.

        personal void LateUpdate()
{
    remodel.place = Vector3.Lerp(remodel.place, cameraPosition.place, lerpSpeed * Time.deltaTime);
}

Movies displaying the issue

jitter virtually solved https://www.youtube.com/watch?v=sxXXk_oVpsg
Practice jitter https://www.youtube.com/watch?v=85biDT_nl_4

2. Add dumping to Cinemachine digital digital camera

outcomes are the identical as with lerping. every part else is easy in addition to the practice

enter image description here

I am going to present any vital data if I have not talked about one thing right here

[ad_2]

Leave a Reply

Your email address will not be published. Required fields are marked *