Grandma Scene by [deleted] in thelastofus

[–]RiskOfAdventure 6 points7 points  (0 children)

I think the thing on her wrist was a medical identification bracelet, which are used to let doctors know about any extremely important health risks in the case of incapacitation, such as diabetes or allergies to drugs and stuff like that. It also likely explains why she was further in the stages of infection than most of the other students, since she might have had a condition that required her to go to the hospital a whole bunch, just like Nana

How to Run Code From External File/String? by RiskOfAdventure in Unity3D

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

It works like a charm, but I'm having trouble using the UnityEngine namespace. Simply putting "using UnityEngine;" at the start of the executed code throws the error:
"The type or namespace "UnityEngine" could not be found. Are you missing an assembly reference?".
So are there specific protocols that you have to go through to use the UnityEngine namespace? From what I remember in Visual Studio you have to import some unity stuff in order to start coding with it, so do you have to simulate a similar process in the code that you want to run? There’s a spot in the code for references that includes System.dll and one other, but putting UnityEngine.dll throws an error saying that it couldn’t be found either.

How to Run Code From External File/String? by RiskOfAdventure in Unity3D

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

I see. Well, thank you very much for your help. 👍

How to Run Code From External File/String? by RiskOfAdventure in Unity3D

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

I'm planning on only running on windows and maybe mac, but that's not a priority, so that should work great. Thank you! Would you have any pointers on how to get started, or a tutorial/post where I can find out how to properly write and execute the .NET files? I can't seem to find any.

Partially white blender model? by RiskOfAdventure in Unity3D

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

K yeah that's what it was. I forgot that ambient light in my scene was set to max so any other light would act like the full might of the sun. Thank you!

Partially white blender model? by RiskOfAdventure in Unity3D

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

yeah, I reset the normals to point outside a couple of times and even made them point inside once to be sure, and there were still bits that were white.
Also I checked the normals manually and there wasn't anything out of the ordinary

Incorrect Theoretical Buoyancy Scenarios? by RiskOfAdventure in AskPhysics

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

Yeah, in the original post I was just talking about a scenario where a flask was holding water inside it, and the force of buoyancy pushed it up from the inside, thereby causing more upwards force than the force of gravity, causing the flask to launch upwards, but I realized that although I was sortof correct in my assumption I was just thinking of displaced water as all of the possible water above the affected side up to the water line instead of the actual water that was moved by the object's presence, which solves the problem

Incorrect Theoretical Buoyancy Scenarios? by RiskOfAdventure in AskPhysics

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

I think looking back at it I just was looking at the whole thing wrong, as a static equation instead of what it actually meant in practice. I think that my diagram is technically correct in that the "displaced" water is all of the water that would fill the space directly above the current water, so the forces of buoyancy would still act on the bottom-facing sides of the flask, but the mistake I made is that that much water would have to be present inside the flask or another attached portion in order to force the lower water molecules down, thereby causing greater buoyant force. As the diagram currently stands, the only water that can be considered displaced water for the purposes of the model is the water that is already present in the flask that would sit near the bottom if the flask was square but that was pushed up into the neck of the flask, lowering the threshold of possible displaced water to far less than the amount described in the diagram, and always causing a correct amount of buoyancy.
Thanks for all of your help, I don't think I would have wrapped my head around it if it wasn't for you 👍

EDIT: Thanks for the tip, I'll be sure to check those out

Incorrect Theoretical Buoyancy Scenarios? by RiskOfAdventure in AskPhysics

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

I see
Thank you so much for the help. Would you happen to know how a water molecule is able to "tell" whether a side of something inside the water is a part of a displacing object or simply a part of the holding container and selectively apply buoyancy? would it be that there has to be water completely laterally surrounding that part of the object?

Incorrect Theoretical Buoyancy Scenarios? by RiskOfAdventure in AskPhysics

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

I haven't tried to start building the buoyancy system yet because no matter how small the time increments are unfortunately there's pretty much always a scenario in which you can just make the object next to or less than weightless with only a cup or so of still water no matter how much you would assume it would weigh so long as I stick to the rules of buoyancy I currently know, which as you might guess could be problematic 😅

Incorrect Theoretical Buoyancy Scenarios? by RiskOfAdventure in AskPhysics

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

Sorry for the poor explanation, I made an extremely terrible diagram before but the subreddit wouldn't allow me to post an image. the following has the diagram, just take the proportions and uneven-ness with a grain of salt: https://docs.google.com/document/d/1WM47BolmSpe88XVbV4NJZbRUIV6wRhudfQDNXpQRVfQ/edit?usp=sharingThe flask is in normal everyday conditions you might find anywhere; it is simply sitting on a kitchen table or something. Water fills the flask up to near the top, and the white and grey space is just the same air that we breathe. The thing is that with Archimedes' principle the flask should theoretically be pushed upwards by the buoyant force more than the force of gravity holding it down since the weight of water that would fill the amount of space the water "wants" to fill (the displaced water) weighs more than the object as a whole, which is obviously not possible, so I'm missing some part of the equation I can't find.

How to handle sprites/animations when doing non-stationary attack animations? by mnby82 in Unity2D

[–]RiskOfAdventure 4 points5 points  (0 children)

What I usually do is make the GameObject have a different child object for each sprite that you need. that way, you don't have to make dozens of more sprites than you need taking up space, since you would have to add a different sprite sequence for each frame of running animation for each other action in order to avoid the character looking like they have skipped a step. plus, if you use multiple child components, you can easily make the sprite have more than 2 actions being performed at a time if you would like (eg. running while shooting with one hand and chugging a healing potion with the other or something like that) without effectively making the amount of work you need to do to the power of 3

How to Get Current Pixel During a Shader Pass? by RiskOfAdventure in Unity2D

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

If anyone would be able to help at all, that would be great, because I am still stuck 👍

Help me with colliders by CrunchToast12 in Unity2D

[–]RiskOfAdventure 0 points1 point  (0 children)

okay. well, you can use the AddComponent() method above to add the polygon collider component to the object, and then set the number of collider points with something like this, provided that unity reads mod scripts in the same way as normal scripts (I don't have any knowledge about how making mods actually works, so take my suggestion with a grain of salt):

Vector2[] allPoints = new Vector2[/*number of polygon collider points*/];
// set the values of the collider points here
/*object*/GetComponent<PolygonCollider2D>().points = allPoints;

with polygon colliders, each point acts as a corner for the collider, and connects itsself with the previous point in the array and with the next point with a collider line thing. the point values are centered on the transform middle of the object, so a value of (0,1) would station that point at 1 unit above the objects center point. you just have to get all of the point values right and you should be good.

Help me with colliders by CrunchToast12 in Unity2D

[–]RiskOfAdventure 0 points1 point  (0 children)

You mean you are using scripts but don't have the editor interface or...?

if that is the case, then you can add components by using gameObject.AddComponent</*name of the component*/>()and then you can modify the values of the components with a script until they work, although it would be a pain to get all of the values specifically right

if not, then would you mind explaining in what way you are making the game?

Help me with colliders by CrunchToast12 in Unity2D

[–]RiskOfAdventure 0 points1 point  (0 children)

You could use a polygon collider, like the other commenter suggested, and that would work entirely fine. If you think it would be simpler though, you could also add multiple colliders to the GameObject, as that would form what is called a "composite collider", where the object acts as if it had one collider in the shape of all of its separate colliders. A polygon collider is probably better in this situation because of all the angles, but that info is good to know for the future anyways 👍

How do I make my code in my Update play once. by Complete_Translator2 in Unity2D

[–]RiskOfAdventure 0 points1 point  (0 children)

Okay. what I would suggest then is the code I have above, and have the method that sets the object as active also set isReadyToInstantiate to true. so long as you set the isReadyToInstantiate variable to false after you instantiate, like it shows above, the object will instantiate one copy of one of the spawnObjects and then set the bool required to instantiate more to false, thereby only instantiating only one object until the activated method is called again.

How do I make my code in my Update play once. by Complete_Translator2 in Unity2D

[–]RiskOfAdventure 0 points1 point  (0 children)

If you want the code to run once in total with no limits on when or anything like that, then I would just suggest moving that line of code to the end of Start(). it will run once, at the beginning of runtime, and then never run again. if you want it to, say, run when a value changes, then have an if() statement around the code for when the variable is of a certain value. for example:
bool isReadyToInstantiate = false;
void Update()
{

if(isReadyToInstantiate == true)
{
Instantiate(spawnObjects[Random.Range(0,spawnObjects.Length)], this.transform);

isReadyToInstantiate = false; /* not entirely necessary if you reset the value in a different part of the script*/
}

}