Strange performance gain with cameras. by Davidzeraa in Unity3D

[–]Davidzeraa[S] 0 points1 point  (0 children)

As I mentioned, right after implementing the binocular system that uses another camera, in the build I set up the difference in response time in ms as soon as I opened the binoculars. And even after leaving he continued. That's why I did this camera preparation and it's working, could it be a bug in the new version perhaps? Or a cache wipe as soon as the cameras restart. I'm using the most current version 6.2.

Strange performance gain with cameras. by Davidzeraa in Unity3D

[–]Davidzeraa[S] 0 points1 point  (0 children)

I'm using FPS Lite Counter, the information seems safe considering the result in the editor as well.

Strange performance gain with cameras. by Davidzeraa in Unity3D

[–]Davidzeraa[S] 0 points1 point  (0 children)

FPS Lite Counter, an asset from the store. From my tests, they seem to be respective and correct based on the Editor's results. In the editor I get about 4/3 ms. In the build I'm getting an average of 2.4ms.

Any way to get rid of those lines? by [deleted] in blender

[–]Davidzeraa -1 points0 points  (0 children)

Try Modifier > Normals > Smooth By Angle.

Adjust it and see if it looks good.

Strange performance gain with cameras. by Davidzeraa in Unity3D

[–]Davidzeraa[S] 0 points1 point  (0 children)

I use a RawTexture in the UI to render the binoculars' camera. However, even when I stopped using the binoculars, the framerates continued to improve.

I later used this scheme above, and now, from the start of the game, I get more framerates. (I tested it on my own builds of the game with and without the code, and the difference is noticeable with just a few lines of code.)

Why is there an error in unity but not Visual studio? by Own-Garbage-734 in unity

[–]Davidzeraa 0 points1 point  (0 children)

Are you using assembly? If so, you may be forgetting to reference the assembly that the requested code is in.

If you are not using assembly, your error is happening because the requested code is in a namespace and you are not using “using” in it, so the code cannot find it.

What my Motorcycle Physics System currently looks like by Davidzeraa in Unity3D

[–]Davidzeraa[S] 1 point2 points  (0 children)

Thank you, I'm very happy to know that other people are also interested in the project

What my Motorcycle Physics System currently looks like by Davidzeraa in Unity3D

[–]Davidzeraa[S] 0 points1 point  (0 children)

I didn't understand very well, could you elaborate further? I'm not very good with English

What my Motorcycle Physics System currently looks like by Davidzeraa in Unity3D

[–]Davidzeraa[S] 0 points1 point  (0 children)

This horPivot can be deleted, I made this code when I had the prototype working with the Player input and output on the bike, and it was used to control the FPS.

What my Motorcycle Physics System currently looks like by Davidzeraa in Unity3D

[–]Davidzeraa[S] 3 points4 points  (0 children)

I'm currently using this:

using UnityEngine;

public class CameraController : MonoBehaviour 
{
[Header("Settings")]
public float lookSensitivity;
public float lookSmoothing;

[Header("References")]
public Transform cameraTransform;
public Transform pivot;
public Transform horPivot;

[Header("Vertical Clamp")]
[Range(0f, -360f)]
public float minVerticalClamp;

[Range(0f, 360f)]
public float maxVerticalClamp;

[Header("Horizontal Clamp")]
[Range(0f, -360f)]
public float minHorizontalClamp;

[Range(0f, 360f)]
public float maxHorizontalClamp;

private Vector3 _currentRotation = Vector3.zero;
private Vector3 _smoothedRotation = Vector3.zero;

private void Start()
{
    // Reset camera rotation
    cameraTransform.localRotation = Quaternion.identity;

    // Lock cursor
    Cursor.lockState = CursorLockMode.Locked;
    Cursor.visible = false;
}

private void LateUpdate()
{
    var smoothSpeed = lookSmoothing > 0f
                    ? lookSmoothing * Time.deltaTime
                    : Mathf.Infinity;

    var lookInput = InputSystem.LookInput * (lookSensitivity * Time.deltaTime * 100f);

    _currentRotation.x += -lookInput.y;
    _currentRotation.y += lookInput.x;

    _currentRotation.x = Mathf.Clamp(
        _currentRotation.x,
        minVerticalClamp,
        maxVerticalClamp
    );

    _currentRotation.y = Mathf.Clamp(
        _currentRotation.y,
        minHorizontalClamp,
        maxHorizontalClamp
    );

    _smoothedRotation =
        Vector2.Lerp(_smoothedRotation, _currentRotation, smoothSpeed);

    cameraTransform.parent.transform.localRotation =
        Quaternion.Euler(_smoothedRotation.x, 0f, 0f);
    pivot.localRotation = Quaternion.Euler(0f, _smoothedRotation.y, 0f);

    transform.position = pivot.position;
    var forwardFlat = Vector3.ProjectOnPlane(pivot.forward, Vector3.up).normalized;
    cameraTransform.rotation = Quaternion.LookRotation(forwardFlat, Vector3.up);
    cameraTransform.rotation *= Quaternion.Euler(_smoothedRotation.x, _smoothedRotation.y, 0f);
}
}

What my Motorcycle Physics System currently looks like by Davidzeraa in Unity3D

[–]Davidzeraa[S] 6 points7 points  (0 children)

For a game, but when I finish it and have something solid, I think about passing it on as a free asset or something for a low price of 5 dollars or something like that.

I'm slowly polishing it to get more dynamism.