All Questions
Tagged with unity mathematics
248 questions
0
votes
1
answer
96
views
Resizing a Sprite in 3D space to match its native pixel size at a target screen resolution?
I am placing a 3D game object with a SpriteRenderer + Billboard attached to it in my scene.
However, since it's a distance away from a perspective camera, the sprite gets scaled, losing a lot of the ...
0
votes
1
answer
85
views
Shrink a Circle's Radius Without Deformation Until It's a Solid Spot
I need to shrink the radius of a ring without deforming it by shrinking it's outline(the way scaling it would).
I need to do this until the hollow fill is gone and its a solid spot.
Here's an example:
...
0
votes
0
answers
27
views
How can I detect which slice of the pie chart my mouse is hovering over?
I'm trying to create a simple pie chart for my game (a strategy/simulation game) to show population demographic data for a province, but I'm struggling to figure out how to detect which slice is being ...
0
votes
0
answers
100
views
Moving SplineAnimate Objects Over Time With Proportional Speed
What I'm doing
I'm using Unity's Spline package and I'm trying to move SplineAnimate objects across a Spline, similar to a racing game's mini-map UI.
...
1
vote
0
answers
129
views
Converting a Transform from Unity's Coordinate System to Unreal Engine's
I am trying to convert a transform from the Unity Coordinate System to the Unreal Engine Coordinate System (and others).
Ideally, I want to take a position, rotation (in Euler angles), and a scale as ...
0
votes
0
answers
114
views
Normals deformation with FFD
I am developing an FFD tool in Unity for the needs of a level designer. It works similarly to FFD box in 3DS Max. I used the implementation described by Sederberg and Parry with a lattice and ...
1
vote
2
answers
81
views
Inconsistent Movement Behaviour between built Game and Playmode
I'm using a simple MonoBehaviour that causes GameObjects to change their position based on a ...
0
votes
1
answer
65
views
Calculating semicircle points of a scaled CapsuleCollider2D
I have a very simple code that draws the shape of a pre-defined capsule. It handles everything well, except the case when the GameObject to which the ...
1
vote
0
answers
21
views
2 object snapping using bounding boxes in Unity Runtime
I am using boundary boxes for all calculations. In the image below you may see a case where this objects need to be snapped. Currently the calculations go as following, the rotation is changed by the ...
0
votes
2
answers
597
views
Normalize an angle in unity
How can I normalize angle between min value and max value?
like normalizing -1136316.78186234° between 0° , 360° or between 180° , 360°.
Node: for now I'm using double value as angle.
Thanks for ...
0
votes
1
answer
23
views
Selection Box Not Positioning Correctly
I found some code that generates a selection box, but when I tried it the box was not starting where the mouse was and I couldn't find the issue.
...
1
vote
1
answer
114
views
Mirroring a Character's Position In a Shadow After Rotating 180 Degrees
Description:
I am creating a 2.5D RPG.
When my character moves from left to right, they rotate 180 degrees to face the new direction. Just like this example.
They also have a blob shadow sprite that ...
1
vote
1
answer
77
views
How to calculate rotation needed to cancel out perspective shift
I have a direction vector that's pointing to (0,0,1) in local object space. How can I calculate rotation needed to rotate it on Y axis so that from camera's point of view it would look as if it's ...
0
votes
1
answer
77
views
How to correctly instantiate a cube over another, or side-by-side another one
In a Minecraft spawn system like, I can't make works correctly following code.
Specifically, if I use Code 1 it works only when I instantiate a cube over another one, not one aside other. The ...
0
votes
1
answer
191
views
How does vector raised to the power of another vector work?
I was watching this tutorial and at timestamp 3:03 he did this:
This blows my mind because I didn't expect that to actually work, how the heck does that work ???? For example, if I have vector (2, 3, ...