# Search Results

1. Post

### What is faster to convert float to int ? (int) randomFloat or Mathf.RoundToInt(randomFloat)

True, but then you're just moving from one mode of categorization to another. Who is to judge on what is necessary and what isn't if that's not...
Post by: orionsyndrome, Nov 30, 2022 at 10:51 AM in forum: Scripting
2. Post

### Question Vector2 Velocity Based on the direction character is facing.

You take the input and formulate the direction relative to the camera. For example AD maps to -1 .. 1 on X, and WS maps to -1 .. 1 on Y. Then you...
Post by: orionsyndrome, Nov 30, 2022 at 10:21 AM in forum: Scripting
3. Post

Ah but I never talked about Mono. If you want performance and can use a different runtime, don't bother with it. There are at least half a dozen...
Post by: orionsyndrome, Nov 30, 2022 at 1:25 AM in forum: Scripting
4. Post

UnityEngine.Mathf is actually implemented that way. Sin is literally implemented like this static public float Sin(float r) =>...
Post by: orionsyndrome, Nov 29, 2022 at 10:16 PM in forum: Scripting
5. Post

@lordofduct Thanks for that. I had my suspicions because it made no sense, but I was lazy to try this for myself. @Max-om Read my post again with...
Post by: orionsyndrome, Nov 29, 2022 at 7:40 PM in forum: Scripting
6. Post

### What is faster to convert float to int ? (int) randomFloat or Mathf.RoundToInt(randomFloat)

Honestly people were always aiming for performance, historically even moreso than today. It's just that with contemporary hardware you a) cannot...
Post by: orionsyndrome, Nov 29, 2022 at 7:32 PM in forum: Scripting
7. Post

If you're bothered with that, use mathematics package instead.
Post by: orionsyndrome, Nov 29, 2022 at 5:09 PM in forum: Scripting
8. Post

### Question Determine best point in a volume

If you're using voxels, I can recommend using Fast Voxel Traversal algorithm instead of doing classic ray casts, because that's much more...
Post by: orionsyndrome, Nov 29, 2022 at 5:04 PM in forum: Scripting
9. Post

For the OP: Try to get a good grasp on what Unity is -- it's a holistic engine, and your code is a mere guest to the party (quote by...
Post by: orionsyndrome, Nov 29, 2022 at 4:44 PM in forum: Scripting
10. Post

That's true and untrue at the same time. There are "Design Patterns" and there are design patterns. Some of the patterns are so ubiquitous and...
Post by: orionsyndrome, Nov 29, 2022 at 4:30 PM in forum: Scripting
11. Post

I will again point out, and this is the 3rd time this week alone, that the historical reason was that C# didn't have a dedicated 32-bit floating...
Post by: orionsyndrome, Nov 29, 2022 at 4:17 PM in forum: Scripting
12. Post

### Question Saving Items in Dictionary

True, it's just a nitpick on my behalf. Simple edit anyway.
Post by: orionsyndrome, Nov 29, 2022 at 1:04 PM in forum: Scripting
13. Post

### What is faster to convert float to int ? (int) randomFloat or Mathf.RoundToInt(randomFloat)

I agree with this. And I agree with this. Yet people can't agree. I think the fallacy stems from the fact that "optimization" is not the...
Post by: orionsyndrome, Nov 29, 2022 at 1:02 PM in forum: Scripting
14. Post

### What is faster to convert float to int ? (int) randomFloat or Mathf.RoundToInt(randomFloat)

Btw, I love how this subject somehow polarizes people. It's crazy. I can see good arguments on both ends of the conversation ever since this was...
Post by: orionsyndrome, Nov 28, 2022 at 7:45 PM in forum: Scripting
15. Post

### What is faster to convert float to int ? (int) randomFloat or Mathf.RoundToInt(randomFloat)

@KelsoMRK Since .net 5 we have the official 32-bit MathF library at our disposal (introduced in Core 2.0 which we couldn't use with Unity), which...
Post by: orionsyndrome, Nov 28, 2022 at 7:38 PM in forum: Scripting
16. Post

### Question Executing instructions in parallel

What you describe shows that you're mixing up several independent concepts. Namely multi-threading (physical parallelism) and parallel simulation....
Post by: orionsyndrome, Nov 28, 2022 at 5:41 PM in forum: Scripting
17. Post

### Question gyroscope rotation

welp that's another way to solve this problem.
Post by: orionsyndrome, Nov 28, 2022 at 5:33 PM in forum: Scripting
18. Post

### Question Fill in the gap of consecutive and disappearing objects

Okay, so there are two ways to approach this as easy as possible. BUT You need to distinguish between two crucial elements of design that will...
Post by: orionsyndrome, Nov 28, 2022 at 4:01 PM in forum: Scripting
19. Post

### Question Fill in the gap of consecutive and disappearing objects

You haven't specified what exactly you need. All I did was a bunch of questions and guesses in post #5. There is no way we can help you unless...
Post by: orionsyndrome, Nov 28, 2022 at 10:39 AM in forum: Scripting