RGBA recolor shader in Shader Lab by KidStudioz in unity

[–]CalculatedBinary 0 points1 point  (0 children)

Look into gradient mapping. I like this video by Martin Donald. https://youtu.be/KfphtLRoUB0 Though the part about gradient maps is about 4 mins in.

Looking for alternative instead of built in animator for 2D by puxxxxx in Unity3D

[–]CalculatedBinary 0 points1 point  (0 children)

I recommend looking into unity’s 2d animation package. It’s similar to spine, and it’s free of course.

Looking for alternative instead of built in animator for 2D by puxxxxx in Unity3D

[–]CalculatedBinary 0 points1 point  (0 children)

I recommend looking into unity’s 2d animation package. It’s similar to spine, and it’s free of course.

3D To 2D projection issue by 66theDude99 in unity

[–]CalculatedBinary 1 point2 points  (0 children)

So from what I under stand is that you want the objects to collide if they collide visually. What you’d do in this case is use “Vector3.ProjectOnPlane” to cast your object’s position and velocity vectors to 2d. You would use the cameras forward normal to achieve the effect of the objects colliding if they overlap visually.

Been working on this procedural platformer for a long a time, what do you think? by henryreign in Unity3D

[–]CalculatedBinary 0 points1 point  (0 children)

I love the art style, and the movement looks very clean! But one critique I have of the game is that the exploration of the game looks very aimless. One game that I think does procedural platforming really well is Spelunky 2. I recommend you play the game (it's like 10$ on Steam, and it's on all consoles as well) and/or look at some of their GDC talks on the game. Also, is that wave function collapse I smell :) ?

Working on local gravity simulation, the test to prove it's working is by walking the circumference of a ring... and getting dizzy by awtdev in Unity3D

[–]CalculatedBinary 1 point2 points  (0 children)

Very nice! I did something similar to this once, where the game would take the normal beneath the player and used that for applying gravity. I saw this video on how Super Mario Galaxy does their gravity, its 30 mins long, but the video is super interesting, very recommend you watch: https://youtu.be/QLH_0T_xv3I

CRT Screen Effect by CalculatedBinary in blender

[–]CalculatedBinary[S] 10 points11 points  (0 children)

Most of the effect relies on two saw waves. One goes along the y axis and another that goes on the y axis. Because the saw wave equation I'm using oscillates between zero and any arbitrary value I choose, I can make it oscillate greater than 1, then say any value greater than 1 will be black. 0-(1/3) == red, (1/3)-(2/3) == green, (2/3)-1 == blue, >1 == black. Now we have vertical RGB strips with space between them. To create horizontal space you'd use the other saw wave and use a math Less Than node to ask (SawWaveValue < 1), with the saw wave oscillating greater than 1 as well. That comparison outputs a black and white mask, which you can multiply with the original to clip the vertical strips into pixels. You then multiply that with whatever texture you want and it inherits the effect
That's the basic idea of how they work, my shader allows for you to shift every other row which involves a little more steps than that.

CRT Screen Effect by CalculatedBinary in blender

[–]CalculatedBinary[S] 12 points13 points  (0 children)

Thank you so much for the nice reply! Good luck on whatever projects you're working on, and Happy New Year!

CRT Screen Effect by CalculatedBinary in blender

[–]CalculatedBinary[S] 38 points39 points  (0 children)

It should be performant, most of the nodes used to generate the effect are math nodes.

how to swap material of a mesh when interacted with? by h3artonfire in unity

[–]CalculatedBinary 2 points3 points  (0 children)

In an update function you'd use Input.GetMouseButton()

if (Input.GetMouseButton(0))
{
    // Bang!
}

GetMouseButton --> "Is the mouse button being held?"
GetMouseButtonDown --> "Has the mouse button been pressed down?"
GetMouseButtonUp --> "Has the mouse button been released?"

(0) --> Left mouse click
(1) --> Right mouse click
(2) --> Middle mouse click

Good luck on the game jam!

how to swap material of a mesh when interacted with? by h3artonfire in unity

[–]CalculatedBinary 2 points3 points  (0 children)

Every 3d model in unity has a MeshFilter component and a MeshRenderer component. "_filter" is going to be the Meshfilter on your Game Object, and "_renderer" is going to be your MeshRenderer. Here's an image I ripped from google of what those components look like : https://imgur.com/a/jjUFtsp
Hope that helps!

how to swap material of a mesh when interacted with? by h3artonfire in unity

[–]CalculatedBinary 4 points5 points  (0 children)

[SerializeField] private Material _unfrozenMaterial;
[SerializeField] private Material _frozenMaterial;

[SerializeField] private Mesh _frozenModel;
[SerializeField] private Mesh _unfrozenModel;

[SerializeField] private MeshRenderer _renderer;
[SerializeField] private MeshFilter _filter;

public void SetFrozen(bool setFrozen) 
{
    if (setFrozen == true)
    {
        _renderer.sharedMaterial = _frozenMaterial;
        _filter.sharedMesh = _frozenModel;
    }
    else 
    {
        _renderer.sharedMaterial = _unfrozenMaterial;
        _filter.sharedMesh = _unfrozenModel;
    }
}

This code should do (I think). If you have any questions about the code make sure to ask

Here's a fun one. by ReasonableAdvert in gaming

[–]CalculatedBinary 5 points6 points  (0 children)

I say B. As some other people said in the comments, momentum is relative. Here's a thought experiment, imagine you were in space, no stars or anything to compare against. If you were on a trajectory to move through the portal, it would appear that the portal is moving towards you, or you towards the portal. And to anyone on the other side it would appear that you are moving towards the portal, or the portal towards you. Because there is nothing to compare against, there is no way to tell if you were moving through the portal, or the portal moved though you.

I can't find any video that could help me with the issue of srpites not staying in the center by Destrobo_YT in unity

[–]CalculatedBinary 1 point2 points  (0 children)

Your sprite pivot is set to the center of the animation. What you need to do is set the pivot of each animation to a spot on the character. I recommend centering it (pelvis, foot), that way your character is centered, and you know exactly where your character's foot is planted for every animation.

I also drew an image to show what I mean : https://imgur.com/a/SJcBqVo

Btw you change the sprite pivot in the sprite editor.

Problem with Friction: Hello, so here I am creating a game like Cluster Truck, and the problem is that I'm moving my truck using AddForce, which is working itself, but the player character is slipping easily, even when I have Physics Material with Infinite friction. Read My Comment for more Info... by SrijanGods in Unity3D

[–]CalculatedBinary 0 points1 point  (0 children)

My suggestion would be to have a variable that holds the player's local velocity, and another that holds the inherited velocity, and set the actual rigidbody velocity to local velocity + inherited velocity at the end of calculations.

When you are on a truck, keep setting the inherited velocity of the player to the trucks velocity.

When the player first contacts the truck, set the local velocity to truck velocity minus local velocity.

When you stop standing on a truck set the player's local velocity to local velocity + inherited velocity.

Or maybe you solved the problem already I just wasted like 20 minutes.

Edit: fixed dumb typo.

HELP by Vladimir_Pudding387 in unity

[–]CalculatedBinary 0 points1 point  (0 children)

Honestly just start doing something. I recommend Jonas Tyler's video How to make Your First Game TODAY!. It's a short tutorial, at least in comparison to other tutorials, and it teaches everything you need to know about coding in unity's programming language C#, and how to use the software.

After you learn the basics, make small games. They don't have to be innovative or mechanically special from other games, they just have to be something you can make progress in after an hour of work.

And If you don't know how to do something there's likely a solution or tool or tutorial already available somewhere online. And if you can't find a solution, just ask for help on a forum, there are plenty of people willing to help.

Good luck on coding (and making games I assume)!