u/Vextin

4,291 post karma · 59.1k comment karma · joined May 2015

Vextin

You're trying to make HDRP volumetrics do something they can't do. The example you posted is not volumetric, it's a bunch of meshes. Volumetric low-poly is an oxymoron.

Vextin

Why the same two jokes over and over and over?

Vextin

My favorite is "all credit goes to the respective companies"

Vextin

This is how knobs usually work in most software (you see it a lot in video editing and audio mixing). I think it's super unintuitive but no, they usually don't follow the mouse. Usually I see it with with horizontal mouse movement, not vertical, though

Vextin

Around the track, how about cliffs? Larger hills?

Vextin
Vextin

She got a lot of mean comments and was having a hard time. She made a comic about how it was hurting her, which inspired a series of meta-comics from other popular creators here over the past week. Most involved the subreddit having a party and throwing around awards in the white room shown in this comic.

Vextin

>:( back in our day, you used the GUI class or nothing at all. Made text with function calls! Designed with GUI Skins! Hard coded UI positions!

Kids these days with their newfangled CSS and visual UI tools...

Jokes aside, the UnityEngine.UI class + canvases are definitely still the official solution (as they should be, they're immensely powerful and easy)

Vextin

The "new" UI system 🤤

Vextin

Oh lmao I forgot you posted your code. Probably needed the [Serializable] attribute on the Unit class

Vextin

That's not an issue with the component or adding it manually.

A variable is only shown in the inspector if it is

1) a private variable with the [SerializedField] attribute, or

2) a public variable

Your variable must be neither of these things.

Vextin

Decided I'd take a crack at it for funsies, updated the repo.

Vextin

Add component -> the name of your script

Vextin

I learned something :)

A correction: 3 is not an "undefined" number, and saying so could confuse whoever you might be communicating with. The generally accepted term for a hard-coded number that should be a variable is a "magic number."

Vextin

What the first commenter said to place the empties.

Then, if you want to spawn a gun there, make a prefab of your gun, then do

``` //Set these in the inspector [SerializeField] GameObject _gunPrefab; [SerializeField] Transform _socket;

void Start () { GameObject gun = Instantiate(_gunPrefab, _socket.position, _socket.rotation); gun.transform.parent = _socket; } ```

If you want to spawn a bullet, do the same, but _socket becomes the barrel of the gun, _gunPrefab becomes the bullet prefab, and the bullet prefab must have a script that moves it forward every frame.

Vextin

Show the code. Are you doing any Debug.Log() calls to give yourself more information? If so, show the console output.

Vextin

Gonna need a lot more detail. What do you mean "automatically go to the inspector?" What is his doing that yours isn't?

Vextin

The shader collection must grow (⁠ノ゚⁠0゚⁠)⁠ノ

Vextin

Assuming that you just need to cache a local copy?

Vextin

I just woke up so groggy brain doesn't have a fully cohesive solution, but maybe that's a good thing, make ya work for it :P

Use a coroutine with a while loop. Inside the while loop, do the big RotateTowards line. The thing you should be multiplying by Time.deltaTime is the xRotationLimit. This may require additional setup to make sure the coroutine is accessing the correct values etc, not sure.

The condition of your while loop may be something like `while( Quaternion.Angle(the_camera_rotation, the_ladder_rotation) > 35f )

Vextin

You're setting xQuat to the clamped value, then immediately overwriting it with an unclamped value. The second argument of the lerp should be xQuat, not the climbing obj rotation

Vextin

Should be fine, only way to know is to try

Vextin

the vehicle trigger must be in a specific rotation in order to work right?

Trigger rotation shouldn't matter, but it will clamp relative to the forward direction of the PARENT of the trigger. If trigger rotation DOES for some reason matter... beats me.

And can I wrap the Quaternion.RotateTowards in a coroutine so that the rotation isn't instant?

Should be able to do that, or Quaternion.Lerp toward the Quaternion.RotateTowards. Shouldn't be too messy.

Don't know how to say thank you enough "Thank you" is plenty :)

Vextin

/u/wenante67 + OP, here you go:

https://github.com/Vextin/Unity-Relative-Rotation-Clamp-Example

commented the code pretty well, lmk if you have any questions.

Vextin

Should the camera rotate when the vehicle rotates? i.e., should changing the vehicle's rotation change the camera's rotation by the same amount?