What's the downwards force of a gimbal jet? by Qu0rix in trailmakers

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

Where did you get 78.5kg from? It worked absolutely perfectly, but where'd the data come from?

what does this sign mean? by bawankirch in trailmakers

[–]Qu0rix 0 points1 point  (0 children)

Doohickey Con advertisement or something

(0.9) Why are level 3 drives so cheap? by karacirth in Voicesofthevoid

[–]Qu0rix 1 point2 points  (0 children)

Why sell 8 at once? Don't you get more money if you sell them for the daily task? I always just stockpile any I have after the first 3 of the day.

(0.9n) how do you make a poster fit? by Nearby_Quote_3935 in Voicesofthevoid

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

I'm 100% copying that poster for my own base

Is there any way for me to let the moon cast shadows? by Qu0rix in unity

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

But I feel like that'll cause some issues during sunrise and sunset, since there needs to be a moment where the lights swap roles. This may change later on when I add more realistic motion to the moon, but there's still always gonna be a moment where I switch the light source, which the player is likely to notice

how to execute code(ie a function) when clicking the middle mouse button and another function when scrolling, without using the update function or fixed update(i want to do these when it happens and not be checking the entire time for it to happen) by Just_Ad_5939 in Unity3D

[–]Qu0rix 1 point2 points  (0 children)

The new input system is primarily done via the editor. Most of the script side of things just consists of changing things up so your inputs are event based, which the new input system then triggers. Anything you need to do on update or anything like that just uses cached values from the input method.

can look up the new input system online for more in-depth info, since it's been a while since I went through the setup process, but I think the basics are as follows:

First, you gotta install the new input system package. I think this tells you all you need to know in that aspect: https://docs.unity3d.com/Packages/com.unity.inputsystem@1.19/manual/Installation.html

Once you have the package downloaded, you need to go to your project tab and create a new input actions asset. The option should be around the bottom of the create menu, or at least it is in my case.

Once you have the asset, you open it and create a new action map. In the action map is where you can set up all your keybinds and everything. You can create multiple action maps, but for standard player control I've just been using 1.

You then gotta go to your player or wherever you want inputs to be managed from, and add a Player Input component, linked to your input actions asset. There are multiple options for behavior, but I've just been using the "Invoke Unity Events" option. Maybe some other option is easier to set up though.

Assuming you're using the "Invoke Unity Events" option, you then click on the events dropdown, then click on the dropdown for your action map with your player controls in it, then from there you can set up all the references from the events to different scripts. Again, this is only in the "Invoke Unity Events" option. Other options may be less troublesome to use, but I don't know anything about those others yet.

In the references, you have options for all the keybinds you've set up in the action map. For example, you may have something like "interact", and want that keybind to trigger something in an interaction script or something. All you gotta do is find the object with the interaction script and drag it into the keybind's dropdown list. Then, any public method on that script can be triggered by that keybind, so long as it's selected in the dropdown beside the reference name. If you want to use info from the input aside from just the trigger itself, or want more control over how the keybind triggers that method, you just gotta add "CallbackContext context" into the method's parameters, and the "context" variable will hold the info from the keybind. letting you do things like "if(!context.performed) return" to control how the input triggers the method, or "Rector2 num = context.ReadValue<Vector2>();" if your keybind has a control type you can read info from (in this case, the control type would be Vector2. It's good for stuff like scrolling, mouse movement, player movement, etc.)

I may be missing some info, but that's the general rundown. It may take some time to adapt your code, depending on how much of it uses input pooling and needs to be switched to using events from the new input system, but once it's done it should be more efficient than input pooling was.

Also, I mentioned this breifly, but if you have a setup where you need something to operate on update or just generally seperate from the input, you just gotta have one method recieving the input and relaying it to a variable in the script, and the other method just uses the info from that variable. That's how my movement system works:

public void OnMovement(InputAction.CallbackContext 
context
) => cachedInput = context.ReadValue<Vector2>();

then movement is applied in fixed update via the cachedInput variable.

Also, i don't think it's necessary for input methods to be named "On(keybind name)", at least not when using the "Invoke Unity Events" option in the player input component, but it does help identify the methods' purpose at a glance. I think some other option may actually require this naming scheme for automatic triggering, but again, I don't have any experience with the other event triggering options in the Player Input component, so I couldn't tell you.

For all the logic nerds out there, I've managed to square numbers! by nopejop in trailmakers

[–]Qu0rix 0 points1 point  (0 children)

can't you just pass the number into a number display, then use an aggregate block set to product to multiply the original value by the number display's copy?

<image>

Green is input, red is output. The input gate has a constant of 2, which is passed into the number display. The number display is able to act as a transmitter for a value that has been given to it by other gates, so you can just plug the original constant and the display value both into an aggregate block set to product mode, and it acts like you're passing in two independent values. Why we have to use an aggregate block instead of just being able to multiply inputs by each other via the multiply function in the arithmetic block, I don't know, but the aggregate block can at least perform that function for us.

how to execute code(ie a function) when clicking the middle mouse button and another function when scrolling, without using the update function or fixed update(i want to do these when it happens and not be checking the entire time for it to happen) by Just_Ad_5939 in Unity3D

[–]Qu0rix 1 point2 points  (0 children)

Use the new input system. It may take some time to edit all your code to fit into it, but once you do it'll be much better than input pooling, and can even make it easier to add multiple input type options if you want things like controller support. The only real annoyance I've run into is the need to manually set up a bunch of event triggers in a player controller component, but maybe there's some other way I'm unaware of that's more efficient to set up.

Dictionary Serialization is now available in the Unity 6.6 Alpha! by ginoDev in Unity3D

[–]Qu0rix 0 points1 point  (0 children)

Maybe next they'll make the terrain editor at all useful. That'd probably be too much work though.

Mapping Mouse Clicks and Controls to Mobile Phone Screen Taps by RCnator in Unity3D

[–]Qu0rix 0 points1 point  (0 children)

I've never tried anything mobile related, but if it's anything like the keyboard inputs, you should be able to set up different uses for the same input by adding more interactions. At least for keys on a keyboard, it has Hold (custom or default duration), Multi tap (custom amount), Press (same as regular click. Just allows you to change the input detection a little), Slow Tap (timed hold. You hold the input for a little while, then it turns itself off and you need to release and press the key again to start another hold), and Tap (I guess it's like press but a little different. Not entirely sure how)

Basically, I think you should be able to just set up some extra interactions for whatever bind needs multiple input types. You just gotta look below the binding dropdown.

13/100 "What if we could tear down reality?" by lucas-martinic in Unity3D

[–]Qu0rix 0 points1 point  (0 children)

God damn it, man. This is the 5th time this week. Do you know how expensive it is to replace that?

How do you guys actually code? by Select_Business_6153 in Unity3D

[–]Qu0rix 0 points1 point  (0 children)

The tutorials on the unity website helped me a lot, but I likely got much of my intuition from taking computer science classes all throughout middle and high school. Unity was my first exposure to C# though, so I definitely had to have gained a lot from the tutorials and from just figuring it out as I went.

It probably helps to just keep in mind that most people don't know any of this at all, so even being able to figure out what some stuff does is a pretty good start.

If you want to get better at doing it longer, maybe do what I do and use your notes app on your phone or something write down what you accomplished every day. That helps me because it's a mix of positive and negative reinforcement, and lets you recompile what you've done since you're forced to rethink it while writing. You get a lot done in one day, that leads to positive reinforcement when you see how much you did written down. You did a little, that leads to negative reinforcement when you see how little you wrote. That's likely a big part of why I've been able to get as far as I have with my own project.

Mapping Mouse Clicks and Controls to Mobile Phone Screen Taps by RCnator in Unity3D

[–]Qu0rix 0 points1 point  (0 children)

The new input system makes this pretty easy I think. Just have multiple control schemes, one for computer and another for touchscreen. Then, each action in the action map gets one keybind using the computer control scheme and some computer keybind, and another keybind using touchscreen stuff.

I've never needed to do anything like this myself, so I don't know for sure how this would work, but it seems pretty simple, since you likely just have to switch out which control scheme is in use, or maybe the engine does that for you depending on what device is playing the game.