#archived-code-general

1 messages · Page 27 of 1

placid ridge
#

Sorry, i forgot to state my problom (i'm an idiot) It's not spawning at the player (setting it here: bullet.transform.position = GameManager.players[playerId].transform.position;)

#

I think it's something with cs bullet.transform.position = bullet.transform.right * GameManager.instance.bulletSpawnTeleportDistance;

clever lagoon
main shuttle
#

bullet.transform.right is the right side of the vector, not the position of the bullet.

main shuttle
#

So 0, 1, 0

clever lagoon
main shuttle
#

So it spawns somewhere on the origin of your game.

clever lagoon
#

^

placid ridge
clever lagoon
#

that confirms it . you want to use += not =

main shuttle
#

Yeah he could do +=, but he could also just specify a bulletSpawnPoint and shoot it from that position.

placid ridge
#

Thanks so much!

main shuttle
#

That way it actually goes with the gun if you rotate it.

placid ridge
#

Yeah

clever lagoon
#

I'm doing a manual raycast to check for mouse over tiles on my strat game map. it does NOT use the event sytem for this.

I would like to detect if the mouse is over a canvas UI element from within this component (so I can arbort/block my custom raycast tests)

I've got this code, but it is detecting hits on canvas elements that the mouse is NOT over. Note that the pointerEventData passed to the raycast take the event system itself as a parameter, rather than the current mouse position- could this be the issue?

        graphicRaycaster.Raycast(new PointerEventData(EventSystem.current), canvasHits);
        if (canvasHits.Count > 0)
        {
            Debug.Log("mouseOver canas element aborting raycast on map check");
            foreach (RaycastResult hit in canvasHits)
            {
                Debug.Log("    " +hit.gameObject.name);
            }
            Cursor.visible = true;
            onMouseExitTile.Invoke(previousMouseOver);
            return;
        }```   EDIT: never mind I got it...  using  ```EventSystem.current.IsPointerOverGameObject();``` works
steady moat
#

You could try:

Express the mouse coordinate in the sprite coordinate
Find the percentage of the new position in the sprite
Use the percentage to figure out the pixel
Read the pixel from the texture 2D

clever lagoon
steady moat
#

Does raycast work on UI element ?

clever lagoon
steady moat
clever lagoon
#

you can always ADD a collider, but not sure about the world/canvas space stuff.

hidden kindle
#

My enemy AI won't move unless I set their Rigidbody's physics material to slippery

#

Is there any way to fix this?

clever lagoon
hidden kindle
clever lagoon
#

if the friction is high, you may need to apply more force to get it to accelerate. (easy to push a large block sitting on ice, but hard to push it when it's sitting on say.. carpet)

solemn raven
#

hi ,
I remember there was a a way to get the current scene name or the current scene index

#

what is it ?

clever lagoon
# hidden kindle Applying force to the Rigidbody

also note that the STATIC friction will be used when the object is still, and the DYNAMIC friction will be used when it's moving. So if they are very different, that could be tougher to handle...

clever lagoon
latent pilot
#

How does one manage a system of counters in a clean scalable way? For instance, let's say I'm making an RPG, and there's two entities fighting: A and B. A uses a fire type attack but B is wearing armor that reduces fire damage, then C comes along and enchants A's damage to ignore armor. Which entity should be responsible for resolving these interactions?

#

I don't know if this question makes sense

vagrant blade
#

There is no clean way when dealing with tags and stacking properties. The manager responsible for resolving the battles should figure it out. Lots of if statements.

valid minnow
#

ok so i need some help with a thing i wanna do, basically i have a text system set up, "see picture below", and i have a plaerprefs string for the player name. i wanna call the playername inside of the text which will be displayed in a text box, i do not really know how to do this and i was wondering if anyone had a solution, thanks!

clever lagoon
clever lagoon
#

normally, you would add one to your scene, then drag that scene object into your script reference. then in your code you simply use textRef.text = "someString";

clever lagoon
#

you CAN do it THROUGH another object (dialog manager), but then you'll need a reference to THAT object in your script

valid minnow
clever lagoon
#

e.g. dialogManagerRef.DialogText.text = "some string";

clever lagoon
valid minnow
valid minnow
clever lagoon
#

no, I'm sorry- explain differently- I'll get it eventually

valid minnow
# clever lagoon no, I'm sorry- explain differently- I'll get it eventually

ok, so i have a playerpref string which is the players name. i have a dialogue box in my scene, with text that displays inside of it. i write the dialogue using the script in the first picture. and i want to take the playerpref string, and insert it into the dialogue i write, using some sort of code word, or some indicator.

#

but since i dont write the dialogue inside of VsCode and i write it inside of Unity idk how to do that

clever lagoon
#

is the text that will display the playername a Text object referenced by the DialogManager? or is it an already existing text in there, and you just want to INSERT/APPEND the player name to text already inside on of those?

valid minnow
valid minnow
clever lagoon
#

perhaps I'm misunderstanding... do you want to just adjust a "string" rather than a dipslayed text? e.g. " Hello [PlayerName] how are you?" to "Hello Glurth how are you?"

valid minnow
clever lagoon
valid minnow
clever lagoon
#

a simpler exmple: string playerPrefName = "Glurth" string originalString ="Hello [PlayerName]!" string finalString = originalString.Replace("[PlayerName]", playerPrefName); // finalString == "Hello Glurth!"

valid minnow
clever lagoon
#

I'm afraid I don't quite understand the setup... but to get it into a text component for diaplay you do somthing like ...textComponent.text = finalString;

#

the circled item being a "Text" Component

hollow kindle
#

does anybody know how i can add to remove the object again with rightclick in this code ?

#

using UnityEngine;
using System.Collections;

public class GridPlacement : MonoBehaviour {
public GameObject tilePrefab;
public float gridSize = 1;
public LayerMask placementMask;
private GameObject currentTile;

void Update() {
    Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    RaycastHit hit;
    if (Physics.Raycast(ray, out hit, Mathf.Infinity, placementMask)) {
        Vector3 point = hit.point;
        point += new Vector3(0, 0.5f, 0);
        point.x = Mathf.Round(point.x / gridSize) * gridSize;
        point.y = Mathf.Round(point.y / gridSize) * gridSize;
        point.z = Mathf.Round(point.z / gridSize) * gridSize;
        if (currentTile == null) {
            currentTile = Instantiate(tilePrefab, point, Quaternion.identity);
        } else {
            currentTile.transform.position = point;
        }
        if (Input.GetMouseButtonDown(0)) {
            currentTile = null;
        }
    }
}

}

clever lagoon
hollow kindle
#

i tried it this way now

#

using UnityEngine;
using System.Collections;

public class GridPlacement : MonoBehaviour {
public GameObject tilePrefab;
public float gridSize = 1;
public LayerMask placementMask;
private GameObject currentTile;

void Update() {
    Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    RaycastHit hit;
    if (Physics.Raycast(ray, out hit, Mathf.Infinity, placementMask)) {
        Vector3 point = hit.point;
        point += new Vector3(0, 0.5f, 0);
        point.x = Mathf.Round(point.x / gridSize) * gridSize;
        point.y = Mathf.Round(point.y / gridSize) * gridSize;
        point.z = Mathf.Round(point.z / gridSize) * gridSize;
        if (currentTile == null) {
            currentTile = Instantiate(tilePrefab, point, Quaternion.identity);
        } else {
            currentTile.transform.position = point;
        }
        if (Input.GetMouseButtonDown(0)) {
            currentTile = null;
        }
        if (Input.GetMouseButtonDown(1)) {
            Destroy(currentTile);
            currentTile = null;
        }
    }
}

}

proven plinth
#

Hello Guys 🙂

I am having trouble exporting my game to Android in Unity for a few days now. When I try to export the game, I get the following error message: Cannot build player while editor is importing assets or compilling scripts. The console is still empty despite this. I am only getting this one error message when trying to export. I am using the shortcut "CTRL + Shift + F" in Visual Studio to search for "using UnityEditor" in all my scripts, which is known to be the cause of this issue. However, I am not finding anything out of the ordinary. Sometimes, there is a script with "using Editor" in the Editor folder or the script name has "Editor.cs" at the end. Can you tell me what characteristics I should look for in order to solve this problem? I would greatly appreciate any help.

solemn raven
#

Hello,
SceneManager has many useful options, but I dont know how to get the Name of the Additive scene the player is currently in (the player can have multiple additive scene open but only one of them the player is considered to be in it ( the last one added ))

#

would this method be accurate ?


Scene[] scenes;
int lastScene = scenes.Length;
string lastSceneName = scenes[lasScene].name;
north swift
#

when I check for a colliders normal, sometimes the normal is on the side of the platform. Can I make it so it ignores the normal on the side? This is in 2d btw I can explain more if I don't make sense, thanks

proper oyster
valid minnow
solemn raven
dusk apex
valid minnow
dusk apex
#

Yes and he's already given you the solution..

#

The concern would be how much have you attempted to do.

#

Folks will likely not integrate/implement it for you - the hard part has already been done.

valid minnow
sweet perch
#

how does the sprite rendering order work? I have a method that returns the name of the game object that the mouse is on and I have a grass tile placed on layer 0, and a transparent tree sprite on top of it placed on layer 3, but when i click on the tree I get grass from the method, lmk if u need more explaining or the code

valid minnow
#

whats the differnce from a string with [] and a string without []

sweet perch
sweet perch
valid minnow
#

ah its an array

#

so can you not replace array strings?

potent sleet
#

or just use a list

#

Oh you mean replace a string , then yea you should

valid minnow
#

for the array string

potent sleet
valid minnow
potent sleet
valid minnow
#

but the replace function isnt there

valid minnow
sweet perch
#

loop and sentences[i].replace

#

replace is a method for strings not arrays i think

potent sleet
#

yes

#

or you can use LINQ

valid minnow
valid minnow
potent sleet
#

but it is 1 line

valid minnow
potent sleet
#

newstrings[] = oldstrings.Select(x => x.Replace("string1", "string2")).ToArray();
or sum

sweet perch
#

that will replace everything right not only when the word player comes up

valid minnow
#

i need to learn about arrays first lol

potent sleet
potent sleet
sweet perch
#

no just placing sprites essentially

#

using perlin noise just placing sprite when the pixel is a certain color

#

dont know how to integrate it with a tilemap

potent sleet
#

so you do or dont want tree selection?

sweet perch
#

i do want it

potent sleet
#

are you using collider to click on or what

sweet perch
#

so rn when i click on a grass tile with a tree on it it returns grass

#

ok lemme explain how im doing this

potent sleet
#

maybe explain how u actually detect clicks first lol

sweet perch
potent sleet
#

ohhh

#

how would that affect sprite renderer tho?

hidden kindle
#

How would I make it so that my Enemy AI will slow down the closer it gets to my player?

potent sleet
sweet perch
#

so i dont really know what the problem is lol

potent sleet
sweet perch
#

im assuming bc they have the same x, y

potent sleet
#

either manually add a third parameters yourself for a "zindex" or depth

hidden kindle
potent sleet
#

or check it in the sprite renderer directly

#

if it's a certain size, grab front only

potent sleet
#

slow down speed follow of the path

hidden kindle
potent sleet
#
if(Vector2.distance(target.transform.position, transform.position) < myDistance){
//slowdown speed
}```
potent sleet
#

just make it a variable you can set in inspector

#

never hardcode magic numbers

hidden kindle
#

So should I replace

if (isGrounded)
        {
            rb.AddForce(force);
            Debug.Log("Pushed");
            Debug.Log("Force = " + force);
        }
``` with
```cs
if (isGrounded && Vector2.distance(target.transform.position, transform.position) < myDistance)
        {
            rb.AddForce(force);
            Debug.Log("Pushed");
            Debug.Log("Force = " + force);
        }
``` ?
potent sleet
#

how are u moving enemy in the first place

hidden kindle
potent sleet
#

um so you would change speed no?

hidden kindle
potent sleet
#

or set .velocity

hidden kindle
#

I don't think I want it to be possible for the player to make the enemy fall to its death by simply jumping over it

potent sleet
#

huh

#

I have no clue wat that means

hidden kindle
#

But its direction is not changing fast enough to make that possible

hidden kindle
potent sleet
proven plume
#

Setting the velocity directly will make it a lot more responsive than using forces.

hidden kindle
potent sleet
#

put a full stop on velocity when you hit edge

proven plume
#

Yes and no. It will be effected but setting the velocity will override the last velocity, That means gravity will get applied but potentially reset every update if you don't handle it. I'd recommend simply applying your own gravity and having full control of the enemy movement.

hidden kindle
# proven plume Yes and no. It will be effected but setting the velocity will override the last...

How do I change it from force to velocity? Here is my current method of handling movement.

// Direction Calculation
        Vector2 direction = ((Vector2)path.vectorPath[currentWaypoint] - rb.position).normalized;
        Vector2 force = speed * direction;
...
// Movement
        if (isGrounded && Vector2.Distance(target.transform.position, transform.position) > myDistance)
        {
            rb.AddForce(force);
            Debug.Log("Pushed");
            Debug.Log("Force = " + force);
        }
stuck pasture
#

can anyone help me with c#

vagrant blade
hidden kindle
#

This problem has gotten too difficult to the point where its not worth fixing anymore

potent sleet
hidden kindle
potent sleet
#

or use MoveTowards once it's close enough, maybe it will work

hidden kindle
potent sleet
#

if ur on the ground tho why do you still need gravity?

#

only use movetowards if ur like close to player and on same Y pos more or less

#

idk I just use raycast for everything

hidden kindle
#

Freaking nothing works

#

Its too slow and I don't know how to fix it

potent sleet
#

lol doubt it's "advanced"

#

just take a break from it

#

come back to it later

#

mind needs rest for solution

elfin vessel
#

hey, with Unity Splines, how expensive is changing the range of a SplineExtrude? I'm using a DoTween to animate the extrusion, but while it's happening it lags my game a lot.

vagrant blade
#

Probably quite a bit, considering it has to remake the mesh

elfin vessel
#

I would assume so, but instead tweeting the end point doesn’t hurt performance noticeably.

sacred magnet
hidden kindle
sacred magnet
#

Proportional integral derivative or something like that

#

Calculates desired velocity based on distance, so you don't overshoot, overcompensate, ...

vague tundra
#

How do I assign a reference to a script on my scriptable object?

steady moat
vague tundra
#

Nope, tis a script that's just chilling in assets, not attached to anything

steady moat
vague tundra
#

Can scripts not be added as references on SO's?:0

steady moat
#

What you want to do with your script ?

#

Answer, and I might have an answer.

vague tundra
#

Will that impact whether or not Unity will accept my reference? 🤡

#

Each SO is a weapon. The weapon needs a reference to a script, specifically written for that weapons, that holds methods unique to that weapon

steady moat
#

It depends🤦‍♂️ Is it a component ?

#

So, the script is an other Scriptable Object ?

#

Does the script has data ?

vague tundra
#

It can be whatever it needs to be

steady moat
#

No, it cannot.

#

That is the point

vague tundra
#

What things can it be then frog man

steady moat
#

Does the script hold data ?

vague tundra
#

what do you consider data

steady moat
#

A state

#

Does it have state

vague tundra
#

no

steady moat
#

Can it be a static function ?

vague tundra
#

mmmmmmmmmmmmmmmmmmmmmmmmmmm

steady moat
#

Should it be, is more the question.

#

Because it could always be with stretch

vague tundra
#

I see, I see. Hmm. When should a class be static?

steady moat
#

Whenever it does not have a state.

#

When it does not make sense to have a state*

#

Math function by example

vague tundra
#

Yeah, alrighty. It is a bit of a weird one - the way ive done it, but I believe it does not have state. So, I guess it can be static. Will that allow me to pass it as a referencial?

steady moat
#

Then create your script as a Scriptable Object.

#

Take a reference to your script in your second Scriptable Object

vague tundra
#

Then I will have one SO type per script, which I do not want

steady moat
#

Use polymorphism if needed with SerializedReference

#

What is the real problem. Because I dont understand it.

vague tundra
#

Sure, I shall provide some more detailz

steady moat
#

You said you wanted to add a functionality in your script (SO) which depends on the weapon.

#

1 SO per weapon + your generalised script

vague tundra
#

1 SO per weapon, indeed

steady moat
#

In other words, we would use the Strategy Pattern

vague tundra
#

Idk about the generalised script:

I'm creating abilities for weapons. Each ability will be its own script. The weapon SO's need the ability to recieve a reference via the Inspector to some number of abilities

#

Are we still on the same page here?

#

Oh fk sorry

#

I've completely greifed this explanation. I've just explained the old way I was doing it...

One moment please

steady moat
#

The abilities should be a prefab. Because it is going to contains a state (A life time).

vague tundra
#

I have a class that inherits from SO called Ability.
Each Ability SO requires some data:

  • name(string)
  • Sprite (sprite)
  • AbilityData (script reference with unique ability methods)
#

AbilityData does not have state

steady moat
#

AbilityData could be a SO

vague tundra
#

I don't want it to be, because then I'd have 1 SO per script

steady moat
#

Then AbilityData shouldnt be a script ?

#

If it is 1 for 1.

vague tundra
steady moat
#

You can make a prefab, use reflection, use Plain Old C#

vague tundra
#

A prefab of what sorry?

steady moat
#

A prefab of your abilities, which you would spawn in the game. The prefab would contain the component that defines your abilities.

#

If your abilities have states, you will need to do that.

vague tundra
#

They dont have state

steady moat
#

It is an alternative, like you asked.

#

You can also use Reflection.

#

Create a dropdown that contains a list of all the available function.

#

Then you can call the appropriate function on runtime.

vague tundra
#

Mmm but each weapon doesnt need to know every available ability - only its assigned handful

steady moat
#

I'm not really sure why you are creating a AbilityData if each ability can only have 1 ability data.

#

You can still add function to a Scriptable Object.

vague tundra
#

Ability is a script that inherits from SO. I create 100's of ability SO's from that one template - each one representing a unique ability. I need a way to assign a script to each one of those ability SO instances

#

I'm probably explaining myself poorly...

steady moat
#

Yeah, that functionality is an AbilityData (abstract class) that could be a SO with a function named "cast".

vague tundra
#

It still doesn't let me assign it, if I inherit from SO

steady moat
#

It should

#
{
    [SerializeField] private Sprite icon = null;
    
    public abstract cast();
}```
#

that could be a way to do it

vague tundra
#

Ooh alright jeez that looks so similar to what I have but it smells like it could be exactly what I'm after... thanks lemme try that for a moment!

steady moat
#

Here is small tutorial that shows how scriptable object can be use in a nested manner. (Didnt watch it completly, it may be shady, but at first glance it was showing what you are struggling with) https://www.youtube.com/watch?v=81kyAHy9gUE

coral hornet
#

whats the best way to make area-based environments, something like terraria but in 3D, where i have a 3D backdrop that will fade in, with specific area-based elements (a boiling hot sun in one area, that fades away when going to another, an ocean of water that obscures anything under where the player should be, that vanishes in the next area, an infinite wall of grassy hills behind the player, that dissapears in the next area), how could i go about achieving this effect?

#

i want these elements to be constantly present in one area, but fade out and unload as soon as they get to the next area

steady moat
#

You want dynamic skybox ?

coral hornet
#

but an entire environment

#

ill set up what i mean.. hold on..

steady moat
coral hornet
#

ok i want something like this, where its a repeating, looping environment, with some elements maybe following the camera (like the sun), and some foreground elements like the water, that will completely fade out when entering a new area, and a new set of these elements will fade in, maybe some spooky trees or a bright moon with clouds

#

im wondering if i should spawn all these elements in whenever the player crosses to a new area, and unload the previous elements, or if i should have all of them pre set up so they can just be reactivated when the player enters the corresponding area

#

or if theres an entirely better way to go about this

#

none of these have to necessarily interact with the player or the environment, but just be there purely for visual effect

#

its not dissimilar to what terraria does, where there is different lighting and clouds and backgrounds for each area, but its in 3D, which makes it much more difficult from my perspective

vague tundra
# steady moat ```public class abstract Ability : ScriptableObject { [SerializeField] priv...

Ahh, no okay so yeah I'd already thought of this, but again, it would mean I'd have a SO instance for each ability, and for each ability data

I've probably put fourth some confusing explanations, but now that I've been attempting to describe it for a while now, here's my most proper explanation:
I have ONE script, called Ability, which inherits from SO. I use CreateAssetMenu in this script, so I can create 100's of ability SO instances.
For each ability, I will have a unique script, AbilityData, containing methods that the corrosponding SO needs access to.

I do NOT want to create an SO instance for each of these AbilityDatas. AbilityData does not contain state.
I simply need to link each SO instance of Ability, to its corresponding AbilityData script

steady moat
#

There is no "clean" solution. Personally, I feel like you are not seeing what a 3D level is versus a 2D level.

Normally, you would design your level such as those elements are part of the scene (Mountain)
You would then use Postprocessing, Skybox, Dynamic Lighting, Particles System, etc. to add more uniqueness to your "biome"

coral hornet
#

im trying to think of a good way to demonstrate this..

#

ok i got an idea, give me a second

#

ok so the player starts walking, and at first, the backdrop looks a certain way, in this case, sunny with green rolling hills, then as they walk into the next area, the old landscape fades out and the new one fades in, and as they fully cross into the new area, the next landscape design takes shape behind them

vague tundra
#

Oh you literally already said that haha

steady moat
#

To be honest, the first one is probably exactly what you want.

vague tundra
#

Checking it out now(:

steady moat
#

You might want to replace [SerializeField] by [SerializedReference]

#

for Effect

steady moat
#

You want dynamic Skybox.

#

Otherwise, put those elements as Props in your level.

coral hornet
steady moat
#

When you do a level linear or open world. You do more than only the level itself, you do the surrounding also.

vague tundra
steady moat
#

You add mountains, tree, rocks, etc. in the zone that you cannot go.

steady moat
#

I mean, you need to do it on the FireBall script

vague tundra
#

"Cannot create instance of abstract class"

steady moat
#

My bad.

#

You need to do it on the child script.

vague tundra
#

All good. See that is SO close to what I want, absolutely. I just need to not fill up my create asset menu with 100's of options that I only ever use once, ya know?

coral hornet
steady moat
steady moat
coral hornet
steady moat
#

Yes

#

Exactly.

coral hornet
#

alright..

#

ok so i have a new issue then

steady moat
#

But again, it could be different for you.

#

If you are faking the 3D

#

Or not.

#

If you have unreachable part

#

Or not

coral hornet
steady moat
#

You make terrain.

coral hornet
#

i have a mesh already that i am using for the background, and i want it to be repeating to bring out the foreground elements more

#

but im just wondering how i should make it repeat

steady moat
#

You create a low definition terrain to be part of your background. (All around your world)

#

Or you use Skybox

coral hornet
#

just a bunch of no-collision, smooth shaded meshes, that are hopefully performant enough to be repeated

coral hornet
#

i want these elements to be 3D

#

i could make a 3D skybox

#

by having the main camera render over a skybox camera

coral hornet
#

but im not sure thats what you mean

steady moat
#

Go look into the scene.

steady moat
#

See how the made the terrain (background)

#

And do not use your mesh for the terrain as the terrain needs dynamic LOD.

#

You could theoretically make a low resolution of a terrain in Blender to be use in background. I would advice to use the Unity Tool instead thought.

#

Alright, I'm out.

vague tundra
#

Thanks for the help and example code @steady moat (:

tepid crypt
#

How do I add light to particles? When I do, the light stays on and if I turn it off, it never activates with the particle effect.

tepid crypt
#

oh right, didn't even consider it

#

sorry

autumn cipher
#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Alteruna;
using System;
public class CustomNetworkManager : MonoBehaviour
{
    public static CustomNetworkManager instance;
    public Spawner spawner;
    public List<Player> players;
    [Serializable] public struct PlayerSpawns
    {
        public Vector3 SpawnPosition;
        public Vector2 SpawnRotation;
    }
    public PlayerSpawns[] playerSpawns = new PlayerSpawns[20];
    private void Awake()
    {
        instance = this;
        spawner ??= GameObject.FindWithTag("NetworkManager").GetComponent<Spawner>();
    }
    public void SpawnPlayer(byte playerIndex)
    {
        var PlayerGO = spawner.Spawn(playerIndex);
        var _player = PlayerGO.GetComponent<Player>();
        players.Add(_player);
        _player.Move.transform.position = playerSpawns[playerIndex].SpawnPosition;
        _player.Look.Rot = playerSpawns[playerIndex].SpawnRotation;
        _player.Look.transform.rotation = Quaternion.Euler(playerSpawns[playerIndex].SpawnRotation);

        //PlayerGO.GetComponent<Movement>().transform.position = playerSpawns[playerIndex].SpawnPosition;
        //PlayerGO.GetComponent<PlayerLook>().Rot = playerSpawns[playerIndex].SpawnRotation;
        //PlayerGO.GetComponent<PlayerLook>().transform.rotation = Quaternion.Euler(playerSpawns[playerIndex].SpawnRotation);
    }
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.F))
        {
            SpawnPlayer(0);
        }
    }
}
public class Player: MonoBehaviour
{
  public static Player player => CustomNetworkManager.instance.players[0];
}
#

Player spawns, gets added to the Players list, everything seems fine but

#

I'm getting these 2 errors, I have no idea why

shell scarab
#

whenever you look up subtracting quaternions, you get something like this: C = Quaternion.Inverse(B) * A; which makes sense because you can't actually subtract them... but one thing I'm confused on that I can't find anywhere, does that mean B - A or A - B???

dense vessel
#

I don't think quaternion additions and substractions make much sense for rotations
If you want to do two rotations, you multiply the quaternions instead of suming them (A * B means the rotation represented by A then the rotation represented by B)

#

But again, I don't know much about that so I might be wrong 😅

lament ocean
#

Could I get some help understanding how NativeParallelMultiHashMap works is there any kind of native data type I can use that works similar to an array of arrays? The unity docs are a little unclear

mystic crescent
#

Why does this fail everytime? string pos = transform.position.x.ToString() + "," + transform.position.y.ToString() + "," + transform.position.z.ToString();

mellow sigil
#

define "fail"

mystic crescent
#

its in timer

#

and other calls doesnt call

#

and debug.log right below it doesnt say what it should

#

its saying 1's

#

and right below this command is to return 2

mystic crescent
#

WAit i think im stupid

#

lemme try this

mellow sigil
#

If you're using C# Timer class then you can't access Unity components from there, it runs on a separate thread

mystic crescent
#

Ah

#

how to fix it then?

mellow sigil
#

don't use the Timer class

mystic crescent
#

Well i cant put it in update or fixed update

#

the server would explode

west lotus
#

Just use this

mystic crescent
#

wats that pic

#

but thx

mellow sigil
#

Why would the server explode

west lotus
#

The avatar of the awsome dude that wrote this awsome free lib

mystic crescent
#

Ah

#

Rip his nose

#

I think my unity fail from like 8k logs

#

What to put in object arguments

#

my intelisence broke

#

oh nevermind

#

so this will work now?

#

It doesnt work

#

NOice everything except some small code works

swift falcon
#

Literally nothing is wrong stop

#

Finally goddamn

#

Haha never mind

#

Hahaha

#

Thanks for creating 2 of the same scripts

mystic crescent
#

Wat's all this?

#

NO WAY IT WORKS

warm night
#

Hey, (sorry in advance if i don't have to do this, idk) does anyone knows about input system rebinding UI package?.. i posted on the channel and i'm kinda close to burnout because the errors are non understandable :/

main shuttle
warm night
#

I followed a YouTube tutorial tbh

#

However, the tutorial pinned doesn't show how to rebind :/

#

My input system works actually, but if i rebind, it fails

#

and i got multiple errors

urban owl
#

why IJobParallelForBatch is missing in unity 2022?

proper oyster
urban owl
#

how to know it is part of the jobs package?

proper oyster
#

not sure why

#

looks like the docu for 0.7 is not ready yet 😅

elder temple
#

Hey...is it possible to delay in Update() using coroutine?

proper oyster
elder temple
#

Is there any other way to delay in update?

proper oyster
#

what do you want to do that would requiere you to use a delay in update?

elder temple
#

I've an enemy object which checks if player is near it in update. If it's near it execute attack(). And I want to delay between attacks

somber nacelle
#

use an if statement and a timer

lucid valley
#

^

proper oyster
#

either use a timer like @somber nacelle sad or start a coroutine and use a bool to only start it once at a time

lucid valley
#
private float timer;

public void Update()
{
    timer += Time.deltatime;
    
    //Run every 5 seconds or whatever you want
    if(timer < 5f) return;
    timer = 0;

    //logic
}
elder temple
#

OOOO...gotta research it. Tnx guys♡

subtle scroll
#

The "bullets" are going in the wrong direction, am i doing something wrong?

mellow sigil
#

If it doesn't do what you want then yes

#

it's set to move them to the orientation of spawnPoint so rotate it to wherever you want them to go

subtle scroll
#

Oh thats probably it, thank you, also, if i move the character does the spawnpoint moves and rotates with it?

mellow sigil
#

¯_(ツ)_/¯

#

depends how it's set up

subtle scroll
#

Wand
----->SpawnPoint

#

Like this hierarcy

#

yeah, im not good at explaining xD

mellow sigil
#

then it moves with the Wand object

subtle scroll
#

Oh Ok, thank you

unreal idol
#

Hi! Please give me a tip about blending between two cinemachine virtual cameras. Both of them have POV Aim (so LookAt is None), and I'm switching by changing priority.
The issue is that virtual camera returns to its position before switching, but I need it to keep new position. I attach video to demonstrate it. Ideally, if disabled camera with follow view direction of the active camera.

hollow locust
#
IConnectionState was not Disposed! Please make sure to call Dispose in OnDisable of the EditorWindow in which it was used.
UnityEditor.Networking.PlayerConnection.GeneralConnectionState:Finalize ()

How do i get rid of this error

muted zealot
#

so, i have child objects with their own rigidbody but i still need the parent to be able to use their colliders. is there a way to make this work?

somber nacelle
#

not a code question, also if those child objects have their own rigidbodies then they will move independently of the parent object and are likely not part of its compound collider

undone oasis
#

Hey i have an issue with unity crashing every time i open a script in my project does anyone know how to fix this ??

nova adder
#

If I want to make a script that controls an entire level (ex all of the traps in an obstacle course) that triggers other scripts in sequence. Where should I put the script in the scene?

steady moat
steady moat
nova adder
undone oasis
#

i'm using unity 2019.4.32f1 LTS if that helps?

lucid valley
#

also you can check the editor log to hopefully see the crash error

undone oasis
lucid valley
burnt tiger
#

How do I move CloudBuildHelper class to Editor folder?

steady moat
lucid valley
burnt tiger
undone oasis
#

?

burnt tiger
#

I'm having an issue with "The type or namespace name "PlayerSettings" does not exist in the namespace "UnityEditor"

#

when I googled it

#

that was the solution

#

but I can't find how to do that

steady moat
steady moat
lucid valley
steady moat
burnt tiger
#

Oh I just create a folder and name it Editor?

undone oasis
burnt tiger
#

Right ok I've done that and it fixed the issue thank you

#

But now it can't find the script 😦

steady moat
steady moat
lucid valley
#

that was what that person made in the forum post

#

it's not something that exists

#

the issue was your PlayerSettings script

sonic harness
#

Does someone how to fix this error? I tried removeing all the headers and on the error message.

autumn cipher
#

I need advice for building the player structure for a multiplayer game, I've been trying using static player property for a while

#

could you guys let me know please?

#

I don't want to use a separate Player instance for every class related to it (movement, weapon and so on)

leaden ice
autumn cipher
lucid valley
#

yeah that doesnt really work for multiplayer, using statics for players

#

as theres more than one...

plain yacht
#

A lot of the pretty decoupling patterns are hard to use as soon as you have more than one player. Or well, at least it was for me. I was going to do a losely coupled event queue to send messages between my movement, stats, inventory etc, but I realised it would be pretty unwieldy with multiple players.

leaden ice
#

I'm talking about instances of objects, not static "instance" variables

#

Those are different things

autumn cipher
#

I was doing this

public class GameManager : Monobehaviour
{
  public static GameManager instance;
  public List<Player> players;
  //Singleton stuff...
  public void SpawnPlayer()
  {
    var _player = Spawner.Spawn(player);
    player.initPlayer();
    players.Add(_player);
  }
}
public class Player : Monobehaviour
{
  public static Player player => GameManager.instance.players[PLAYER INDEX HERE];
  public Movement Move;
  public Weapon Wep;
  private void initPlayer()
  {
    Move = GetComponentInChildren<Movement>();
    Wep = GetComponentInChildren<Wep>();
  }
  private void Update()
  {
    Move.doUpdate();
  }
}
public class Movement: Monobehaviour
{
  public void doUpdate()
  {
    //MovementStuff...
    Player.player.Wep.doSomethingAboutWeapon();
  }
}
public class Weapon: Monobehaviour
{
  public void doUpdate()
  {
    //WeaponStuff...
    Player.player.Move.doSomethingAboutMovement();
  }
}
#

holy hell next time I'm writing this on code editor first

autumn cipher
severe rune
#

heya, im in need of a bit of advice, id like to give the player in my game the ability to spawn vegetation (flowers, trees, bushes, etc) on surfaces in the game, and i wanted to ask what would be the best way to go about doing this?

right now im thinking about creating an action that triggers when they press a key, which creates the corresponding flower/tree at the location of the cursor, but i cant help but think theres probably a better way of doing this

solemn latch
#

Hello! Anyone know how to get Light type in script?

deep fable
#

How can I get a list of all the scriptable objects (of type Card that inherits ScriptableObject) that are in a specific directory?

#

I am doing: csharp var cards = Resources.LoadAll<Card>(directoryPath);
But it gives me an empty array

rain minnow
solemn latch
#

so i can save it into json

modest pawn
rain minnow
hexed pecan
#

Like theres no sub classes, or am I wrong?

rain minnow
plain yacht
#

@deep fable I found this post: https://answers.unity.com/questions/1393857/resourcesload-for-scriptable-objects-can-it-be-don.html and it seems to imply that Resources.LoadAll is not what you want to be doing.

deep fable
vagrant blade
#

@subtle scroll Don't crosspost

tired fiber
#

Can someone help me with error in code?

hexed pecan
subtle scroll
deep fable
# deep fable Mmh.. and is there any way to do that?

Ok I've found a solution, but now there's another problem.

If I try to create a SO from code everything is fine.. but as soon as I recompile the project, I get a SerializedObject target has been destroyed error and the SO I created gets destroyed.

#

(I am trying to make a custom editor that creates a new instance of the Card ScriptableObject for every type that inherits an Effect class, but every time I recompile everything is wiped..)

subtle scroll
vagrant blade
#

Wait and repost, or bump it.

#

This is a purely volunteer run server, there's no guarantee that anyone will want to help

subtle scroll
#

I know, i just didnt wanted to crosspost

cold egret
#
  • I tried learning DI recently and i didn't get the part of defining a container. Am i supposed to simply hardcode them inside my object? What about testing, when i need to insert different containers with mock objects?
rain minnow
deep fable
# rain minnow Are you saving the asset after it's created?

Yeah:

var newCard = ScriptableObject.CreateInstance<Card>();
AssetDatabase.CreateAsset(newCard, directoryPath + "/" + effect.ToString().Replace("Effect", "") + ".asset");
AssetDatabase.SaveAssets();
EditorUtility.SetDirty(newCard);
newCard.Effect = effect;
#

The problem may be that the Card class has an Effect field inside it which is an abstract class (and I set the Effect field from code instead of inspector).. I don't know if Unity can serialize the Effect field

rain minnow
deep fable
#

Yeah

#

from code

#

Ok I may have solved the error

#

(basically I am making a card game and each card has a different effect and is represented by a SO. I have made a system that everytime I compile the project, it searches for all the Effect subclasses in the project, and if there isn't already a card associated with that Effect it creates one. Now it seems to work!)

potent sleet
#

dont crosspost

#

its such a basic thing

#

google it

simple egret
#

So what did you try?

#

Post some of your code

potent sleet
#

<@&502884371011731486>

#

learn how to google then pleb

deep fable
simple egret
#

Essentially, get a direction that points towards your target, and look towards that

potent sleet
#

you lying little shit

#

maybe you're too inept to use the internet

deep fable
# rain minnow Cool, what was the fix?

Sorry I don't remember what the exact fix was, but it should be the fact that I moved the code that does that from a custom editor to the OnEnable function of the Card class (which is the SO), because effectively I didn't need a custom editor (and I read that custom editors can cause this type of problem)

(If you want I can show you the code)

prime sinew
#

This is getting needlessly hostile.
<@&502884371011731486>

simple egret
potent sleet
#

but u right, this aint worth my time

prime sinew
#

I think there's a function called LookAt

#

Try using the words look at, instead of point towards

potent sleet
prime sinew
#

Okay

potent sleet
#

var dir = target - transform.position;
it's literally just transform.right = dir;

prime sinew
#

Look up how to get the direction towards another object or something

simple egret
#

Yeah you'll need a direction, don't pass the position of the other object directly

rain minnow
#

I'm confused. If you got all of these results, what have you tried? You should have some type of code . . .

potent sleet
#

da boy can't read

rain minnow
#

Okay, but did you actually try any of those links bc I've looked at a few and they provide answers. That's what I'm confused about . . .

tough osprey
#

Does TileMap.SetTile have a performance cost if the Tile being set is already set there? Should I do my own check and only call this when I know the Tile will change? eg, when the user action is causing the TileMap to preview a change which will cause potential calls to SetTile every frame.

potent sleet
rain minnow
#

@swift falcon but anyway, they were correct before, don't cross-post, especially since this is a beginner topic/question. I'd check out those links you posted from your search. They have the answer . . .

tough osprey
#

Also, it's really weird to think that the entire TileMap refreshes every time a single Tile changes. Shouldn't it just expand outwards from the change and update rule tiles?

deep fable
#

Is there a way to set a custom icon for a specific SO? (because for now, doing EditorGUIUtility.SetIconForObject sets the icon for the script, not for the individual SO)

severe coral
#

Hi, would this work for reading an array, list, hashset, or dictionary from a file?

    /// <summary>
    /// Read a collection that can use a signature to reference length.
    /// </summary>
    /// <typeparam name="ColT">The collection's type (e.g. string[], List<int>, HashSet<GameObject>, etc.)</typeparam>
    /// <typeparam name="SigT">The signature type, must be numeric integral type. (sbyte, byte, short, ushort, int, uint, long, ulong)</typeparam>
    /// <typeparam name="ValT">The collection's stored type (string, int, GameObject, etc.)</typeparam>
    /// <param name="signatureReader">The function that reads the signature from the file.</param>
    /// <param name="valueReader">The function that reads the values of the collection from the file.</param>
    public static ColT ReadCollection<ColT, SigT, ValT>(Func<SigT> signatureReader, Func<ValT> valueReader) where ColT : ICollection<ValT>, new() where SigT : struct, IConvertible
    {
        int count = (int)Convert.ChangeType(signatureReader(), typeof(int));

        ColT collection = new ColT();

        if (collection is ValT[] array) // Is Array
        {
            array = new ValT[count];

            for (int i = 0; i < count; i++)
            {
                array[i] = valueReader();
            }

            return collection;
        }

        // Isn't Array

        for (int i = 0; i < count; i++)
        {
            collection.Add(valueReader());
        }

        return collection;
    }
simple egret
#

What about JSON serialization? These 3 collection types are supported out of the box

lethal vigil
#

Hey im getting a really weird issue where a game object only delete if the scene view camera is facing it, so if i go full screen or turn the camera away it wont delete ```

void Update() {
GameObject objectToDestroy = GameObject.FindWithTag("PLEASEWORK");
if (objectToDestroy != null)
{

        StartCoroutine(DestroyObjectCoroutine(objectToDestroy));
    }

}

IEnumerator DestroyObjectCoroutine(GameObject objectToDestroy) {
yield return new WaitForSeconds(3);
Debug.Log("DESTROY");
Destroy(objectToDestroy);
}

simple egret
severe coral
severe coral
simple egret
#

Then you'd want a custom binary serialization

severe coral
simple egret
#

With a file format you create yourself

severe coral
patent lake
#

is it normal to have so many children on a rigged enemy model?

severe coral
potent sleet
patent lake
potent sleet
#

so think of it that way, those are bones for the rig

#

yes it's totally normal

patent lake
#

alright, just thought maybe there was an optimisation to condense them somehow perhaps
thank you fellow cat enjoyer

proper oyster
patent lake
steady moat
steady moat
whole yew
#

whats a quick and easy way of giving the user playing the game with some sort of message like an alert/notification

whole yew
#

bruh

#

ik UI but im asking an implementation lol

steady moat
#

Toggle a UI element

potent sleet
#

so then learn how you can formulate a better question

#

what? just show a popup with a GameObject.SetActive

whole yew
#

all the info i got i already knew

potent sleet
#

again so then learn how you can formulate a better question

safe cape
#

hi, how could i get an array/list of all the objects the mouse is over in a 2d game? thanks!

whole yew
potent sleet
#

if you say so

whole yew
#

why u gotta be rude and sarcastic

potent sleet
#

I never really stopped and took the time to think about it

#

not sure

steady moat
#

@whole yew, the most fast and easiest way of showing a notification to a player is to toggle with gameobject.SetActivate(true) where the gameobject is a UI Panel.

#

If it is not what you meant, then your question is not formulated correctly.

whole yew
#

I was thinkin something like spawning in a text object with a moving animation and then quickly fades away

steady moat
#

Your question is not: whats a quick and easy way of giving the user playing the game with some sort of message like an alert/notification

whole yew
#

I think dotween would be good for something like that?

#

never used it so idk

steady moat
#

But more about patterns

#

You should look into what patterns can be used to make a clean UI.

simple egret
#

You can queue up notifications (with a Queue<T> collection), and have a script look at the queue and manage the UI

steady moat
whole yew
#

my project is almost near the end of finishing im just polishing stuff up right now and need a dynamic way of notifying the user of some stuff but nothing too complex cause im lazy and its not that important

simple egret
#

Dotween would be the easiest way of doing the animation yeah.
And probably more performant, since conventional Animator will redraw the entire Canvas each frame, even if there's no movement

steady moat
#

I prefer the conventional Animator because it has more feature and can be use directly by Artist. It also come with built in statemachine and act like a good layer between your art and your logic. If performance is an issue or a constraint, then you might want to go with Dotween like suggested.

#

Also, it is easier to setup with an Animator as can record/preview "your animation".

sand osprey
#

how can i configure vscode ? Its already connected tp unity and i have the csharp extension, .net installed, it just doesnt highlight errors

tawny elkBOT
#
Visual Studio guide

If your IDE is not underlining errors in red or autocompleting code,
please configure it using the link below:

Visual Studio (Installed via Unity Hub)
Visual Studio (Installed manually)

lucid valley
#

!vcode, why isnt it vscode uh

tawny elkBOT
#
Visual Studio Code guide

If your IDE is not underlining errors in red or autocompleting code,
please configure it using the link below:

https://on.unity.com/vscode

sand osprey
#

i followed the thing ,all that i did was set vs as the preference in unity, still no underlining

#

oh nvm i did the first and not the second link

#

im so confused

polar marten
whole yew
#

eww rider

proper oyster
whole yew
#

no but I seen how bad it looks lol

#

I dont like jetbrains stuff

polar marten
whole yew
#

jetbrains stuff is not for me sorry

polar marten
#

oh nevermind

#

i'm not sure what the answer to your question is

#

sorry

crimson atlas
#

has anyone had any experience with an odbc data connection screwing with the new input system?

#
    void Start(){
        DatabaseConnectionController.OpenConnection();
        DatabaseConnectionController.CloseConnection();
        Resources.LoadAll<Item>("").ToList().ForEach(x => ItemMemoryReference.AddItem(x));
        SceneManager.LoadScene("GameScene", LoadSceneMode.Single);
    }```
made this and kept removing things until the input system in the "Game scene" that gets loaded worked.
it only works when the connection is never opened nevermind closed

```csharp
using System.Data.Odbc;
using UnityEngine;

public static class DatabaseConnectionController
{
    public static OdbcConnection connection;
    private static readonly string connectionString = @"Driver={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ="+ DirectoryLibrary.DataBaseDir +";";

    public static void OpenConnection(){
        // Debug.LogError("");
        connection = new OdbcConnection(connectionString);
        connection.Open();
    }

    public static void CloseConnection(){
        connection.Close();
        connection.Dispose();
        connection = null;
    }
}
#

chatGPT canne waffle an answer so i got no ideas left haha

#

this only happens in build mode btw, works fine in editor

steady moat
steady moat
crimson atlas
#

exactly there should be no interference but somehow, when i dont open the connection it works, but when i do it doesn't.

no errors in the editor console or build logs at all

#

keyboard just ceases to exist (mouse works fine so the input system does kinda work?)

steady moat
#

The issue seem complex because it is larger then your code. If I were you, I would not use ODBC.

#

Keep it simple. Learn. Then you may want to attack harder issue.

karmic bloom
#

Question, if I'm going to have a lot of scenarios to allow the player to move like below:

               if (hit.transform.gameObject.tag == "Red")
                {
                    MoveDown();
                }

                if (hit.transform.gameObject.tag == "Blue")
                {
                    MoveDown();
                }

                if (purple && hit.transform.gameObject.tag == "Purple")
                {
                    MoveDown();
                }

Is there a better way to put this? Because there's also going to be scenarios where say if you're purple - you can only move to red or blue. I know this works, but it's ugly and requires more work than I'm sure necessary

nova axle
#

Hey guys, I'm having this idea which I have no idea how to realize.

Essentially I'd like to make a 2D dynamically curved textured line. In my specific case I'd like to make a sort of animated "magical beam" which can be curved and adjusted. I'm however unsure how to do this.

I've tried LineRenderer with custom Sprite Shader, which takes textures from Texture2dArray based on time. That however results in all tiles using the same sprite at the same time. As the TileRenderer tiles the shader itself, I can't offset some tiles etc. I also can't let the TileRenderer stretch the material, as I don't know the final length of the line in advance.

TL;DR: Is there any way to create a dynamically curving animated line textured with tiled, individually animated sprites without building it from ground up?

For reference, the gif is what I have now, and is almost enough apart from the fact that I need each of the segments (not of the line itself but rather the tiled sprites) to be animated independently of all others, i.e. in a random-like manner.

inner yarrow
#

Is there something like Physics.CheckBox for any mesh (basically, is there anyway to do Physics.CheckMesh).

steady moat
inner yarrow
#

If not, what would be a good way to do this, because I need to be able to find out at any point if my object is touching something, and I will not ever know what type of collider it is.

karmic bloom
#

You need to know the type of collider?

steady moat
inner yarrow
steady moat
inner yarrow
#

Oh, thank you.

steady moat
#

Also, you have on collision enter

inner yarrow
#

I don't really want to use that, because I want to be able to call this in a seperate event, but sphere cast or check spere should work

steady moat
#

ClosestPoint works fine too. If your mesh is convex.

karmic bloom
#

You have any suggestions on my question above?

steady moat
#

it is hard to find a good architecture because of how little I am working with.

#

Otherwise, you might want to look into Polymorphism

#

In fact, you probably should look into polymorphism

dapper flower
#
// NotSupportedException: Specified method is not supported.
// System.RuntimeType..ctor () (at <0da48681ced7494d83ae6a612d2206fc>:0)
// UnityEngine.Resources:LoadAll(String)
// TG.Frameworks.NodeTrees.Editor.NodeTreesUnityLoadProcessor:.cctor() (at SOME LINE)
// UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes(Type[])

        static NodeTreesUnityLoadProcessor()
        {
            _nodeTreeObjectsDictionary = NTStaticBlackboard.GetAllNodeTreeObjects();
            if (_nodeTreeObjectsDictionary is { Count: > 0 })
            {
                _nodeTreeObjectList = new List<INodeTreeObject>();
                foreach (var values in _nodeTreeObjectsDictionary.Values)
                {
                    _nodeTreeObjectList.AddRange(values);
                }
            }
            else
/*THIS LINE =>*/ _nodeTreeObjectList = Resources.LoadAll<NodeTreeSO>("").Cast<INodeTreeObject>().ToList();

            OnUnityBoot();
            OnUnityLoad();
        }

```First time I'm seeing this and I have no idea what it is
cold egret
steady moat
#

The results of Resources.LoadAll<NodeTreeSO>("") cannot be cast in INodeTreeObject

cold egret
# steady moat Dependancy Injection is mostly implemented with Reflection
  • I get this, i mean there has to be containers defined. Those with bindings, a set of rules according to which instances are provided. And i assume i have to create new instances of them all over the place since they're plain objects
  • However, with this approach there's still direct dependency upon given types. Furthermore, i can't change containers, for example for testing or for modifying the game's behaviour, etc.
dapper flower
steady moat
dapper flower
steady moat
steady moat
cold egret
nova axle
# steady moat I'm not sure what you are asking

Yeah, I was afraid of that, sorry. 😄

Basically I want to be able to have a script or object of some sort, into which I can put in a set of sprites and set of points. Based on those, it will generate a curved line passing those points, and will be textured by those sprites. But additionally, I want those sprites to be animated, e.g., randomly.

I tried my best to find something existing that coincides with my desired end goal, best I could find is the Mutation from Enter The Gungeon, e.g. see here:
https://youtu.be/MwHx6dOj_N4?t=862

Now I suspect the gun in the video is created as a stream of many projectiles dense enough to create the feel of a beam, but I'm hoping to create a single object, as I don't care about collisions, damage, etc.

Hopefully that explains it a little bit better.

dapper flower
steady moat
steady moat
nova axle
#

That's an interesting perspective on the issue. I didn't think about that. I'll look into it, thanks. 🙂

cold egret
# steady moat I'm familiar with Dependency Injection. But the one I used/created all use Attri...
  • Well, maybe i name things wrong. That part when you define lifetimes for types: scoped, singleton and transient. They're stored within a single object, according to my knowledge this object is called container. Reflection and instancing happens way down there and it works flawlessly, the problem is storing scopes. Since "container" is a plain object, it means i have to instantiate it and register types there with their lifetimes. What is unclear to me is where are they supposed to be created. If i define them directly inside my actual objects, i don't remove any dependency, i just overcomplicate everything. So what is the "right" way to provide those containers is my question
steady moat
#

You then instantiate them from your ServiceLocator/Container

cold egret
#
  • Does this attribute come out of box or is it a custom one?
#
  • The [service]
steady moat
#

It is how I would name it.

cold egret
#
  • I have never been to attributes. Is there any short summary of what would it do in this specific case, or is it too long and i should learn it myself?
cold egret
#
  • Okay, thanks
whole yew
#

would someone be able to rate my project structure? Either by joining a screen share or me sending a video of the project? It would only take about 5ish minutes.

#

If so, could you dm me? Because I can do it anytime tomorrow (it’s 12am for me rn)

karmic bloom
steady moat
subtle herald
#

I'm making a solar system game/generator which lets a user select one of the 7 main sequence star classes to generate with realistic yet randomized values such as radius, luminosity, color, temperature, etc. All of the actual value generation is being done in my StarProperties class below (1st link). The second link is my SpectralTypeButton class which is attached to all 7 buttons representing each star class you can pick in the selection menu. All the calls to my random value generation are in this class so that when a user selects any of the available classes, the data is then generated, and for now, displayed on screen. The last link is my SaveManager class which I wrote so I could save the values generated within StarProperties. I would really appreciate it if someone could help me understand how to link my SaveManager to the generated values so they actually get saved. I've tried a bunch of stuff but the save file only ever returns 0's for the double values and false for the bools. Saving data is entirely new to me. 😄

https://paste.myst.rs/an75zluq
https://paste.myst.rs/1s3we1xa
https://paste.myst.rs/3f5q8iew

digital whale
#

I'm having an issue with a bug where my slime can get hit,but no matter how many times I hit it,it can't die.(Code for the slime:https://paste.myst.rs/15nn8y3v)

proper oyster
subtle herald
digital whale
# digital whale I'm having an issue with a bug where my slime can get hit,but no matter how many...

Also,I'm trying to follow a tutorial for this program.I'm at around 46:20(Tutorial here:https://youtu.be/8rTK68omQow)

Guide on how to build a top down 2d RPG from the Ground up in Unity 2022. The goal of this crash course is to cover as many relevant beginners topics as we can but linked together in actually building out some prototype mechanics for a potential game.

Better Knockbacks Update Video https://youtu.be/yna_u1OASy0
Scripts and Project https://www.pa...

▶ Play video
proper oyster
# subtle herald Wdym?

you seem to write a xml file called currentSolarSystem.xml to disk
does the values in that file look like you expect them to be

subtle herald
#

Luminosity, for example should be huge, like 425,000,000,000,000,000,000.00

proper oyster
subtle herald
#

You mean by attaching my SaveManager script to an empty game object like so? If so, then yes. 😄

proper oyster
#

do you set the values of the activeSave variable via code?
i cant find any reference to that in the scripts you posted

subtle herald
#

I do not, as of right now. I tried like 8 different ways but none of them worked. Still kept getting all 0's and false. lol

proper oyster
subtle herald
#

Yes, I know that. In my original post I was asking if anyone knew how I could. Because I tried several ways and none of them worked.

proper oyster
#

get a refrerence to your SaveManager component that is on that SaveManager gamobject
then you can do

saveManagerVar.activeSave.savedStarAge = 99.99;
subtle herald
#

I tried that several times and it never worked. Here is what I tried just now and still nothing.
I did this in StarProperties.

void Start()
{
    SaveManager.instance.activeSave.savedStarAge = Age;
}
proper oyster
subtle herald
#

The value is still 0.

proper oyster
#

ok lets test the save part only
just put some test values into the inspector while the game is running
delete the save file
then save via the save function
does it contain the test values

#

breaking down the problem into smaller and smaller parts until you can solve / test them is the way to go

subtle herald
#

Yeah, I deleted the file so it would be a brand new one.
Then I put 9.7 for the age as a test. Saved it.
Quit the game.
Restarted the game, loaded the save. And the value was there.

proper oyster
#

so save and load seem to work
its only setting the data that need to be saved seem to be the issue

subtle herald
#

yes

proper oyster
#

try moving setting the data out of start to a later point that might be the issue

subtle herald
#

I thought that might be it too but wasn't sure where else to put it. Any ideas?

proper oyster
#

why not put it into GenerateStar like in line 73 of SpectralTypeButton

#

then it should set the values when you generate a planet

#

and then you can call save after that

subtle herald
#

okay, I'll try that real quick

#

OMFG, you're a genius!!

#

😄

#

That worked

#

I've been struggling with this all day lmao

proper oyster
#

nice glad its working now

subtle herald
#

Thank you!!!

rain minnow
subtle herald
#

Yeah I know, just my OCD brain making sure everything is as readable as possible.

north swift
#

Anyone know how I could replicate like the acceleration of addForce using rb.velocity? My brain is fried so I cant think of anything :/

rain minnow
north swift
steep herald
#

rb.velocity += your direction * speed would be ForceMode.VelocityChange - ForceMode.Impulse is the same except it factors the mass. I'm not sure how exactly, I assume (total force /mass).

The 2 forcemodes remaining are the same essentially except they factor in the fixed deltaTime. Something like your normalized direction * speed * Time.fixedDeltaTime for ForceMode.Acceleration, and I guess ForceMode.Force looks like
rb.velocity += (Time.fixedDeltaTime * speed * normalizedDirection) / mass

#

not 100% sure that's how mass is factored in, someone else can chime in

rain minnow
olive berry
# subtle herald I'm making a solar system game/generator which lets a user select one of the 7 m...

Thats about what I did too: https://www.youtube.com/watch?v=96cIYun83FE

Yes, these are actual 1:1 size stars of 1400000000m big or 80x as big!
Star Trek TNG, And all games since just use like particle effects... Impressive, but this warp effect I invented and many said could not be done has been done. ENJOY!

www.starfightergeneral.com

We run a guild. Opportunity: I can teach you how to make games for free better...

▶ Play video
north swift
subtle herald
olive berry
#

My game is like an Elite Dangerous, except the skybox is realstars

#

and when you go to wrp, the stars become real game objects

#

and then the skybox is painted when you exit warp

subtle herald
#

Nice, I'm just doing one system, generating realistic ones with tons of other data and randomized system history's like DF. 😛

olive berry
#

pretty sure no one's ever done this,

#

Steve if you want to work with Starfighter General, you can, I will not have very pretty stars at first

#

So if you going pretty route, I can drop youcode n stfuf

#

My code is similar in Star code types, I researched emon youtube

subtle herald
#

I'll think about it. My thing is in VERY early development and I'm doing it purely as a fun little side project.
Once I get all the relevant physical data setup correctly I'll be rendering the star in the system.

#

Then planets.

olive berry
#

Ok, let me know if you can make em look pretty

#

I have it already to position n stuff

subtle herald
#

I'm an artist first, programmer second so I should be able to. Just need to learn how with Unity first. lol

olive berry
#

Hey, want my proc gen star code? I can jump start you

#

Wait...

#

There's a bug in UNITY for large negative value entities

#

And ECS isn't good for a nub

#

Yeah you do you, stay in touch tho man

rain minnow
olive berry
#

I need a proc gen galaxy soon,

#

Do it up good, I drop you rev share

subtle herald
#

that'll be fun for you, I'm doing anything nearly as expansive as a whole galaxy
(though I will have a "galaxy" background of sorts though for realism)

olive berry
#

Well it works like this

#

Make one system

#

And then you can just roll it 1 million times

#

We could roll it 500 billion times

#

but huge galaxies are too lonely for MMO crowd

#

They want to see people a bit

#

If you can randomly generate a system, planets & star(s), and make it look pretty, that's key. I see you're doing composition of stars by element,maybe you could do dynamic textures based on taht

#

I mean we both can do it, but lets reconvene when we both have more done

#

Proc gen galaxy for me aint' for another 2 months or so, lots of work to do before then

subtle herald
#

lol, for sure

#

I only plan on doing singular systems but I'll def keep you updated on the progress. The actual game objects and graphics are getting closer every day haha

kind grove
#

Hello! I have a script where I want to be able to right-click and identify if my cursor is pointing at a sprite and if so what sprite. Googling tells me to edit a sprite's "OnMouseOver" function but I only want to check in this one script, not edit every sprite I have in the scene. My relevant sprite characters all have colliders, if that helps.

#

If it was 3D I could do a line trace but I don't know the equivalent for sprites.

cosmic rain
#

Visuals don't matter in this case. Only the type of physics that you're using(colliders). If it's 3d, you use a ray/lineCast. If it's 2d you can use OverlapPoint.@kind grove

kind grove
#

OverlapPoint? Thanks.

#

@cosmic rain I've got it working, but the gizmo I am drawing only appears in the scene view. Is there a way I can get gizmos to appear in game view? Or is there some asset pack I can get with debug spheres/lines I can render on screen?

cosmic rain
kind grove
#

Ah, the dropdown is a toggle. Nice.

dusky lake
#

Any way to get the absolut scroll distance from a scroll rect? The event (and normalizedPosition) only give the normalized (0 - 1) position, do I have to use content height * normalized position to get the scroll position or is there something internal?

#

Basically l want to do a reload once the scroll rect is pulled down > 400 units while its at the top

winged karma
#

Hey all,

Is it possible to change a canvas's color at runtime and somehow also control the alpha? It seems to revert to a 0 alpha (and is therefore transparent) when modifying the color attribute of the Image component, but when attempting to modify it through script I get the error "Cannot modify the return value of 'Graphic.color' because it is not a variable"

dusky lake
winged karma
#

Inside the Image component

leaden ice
#

You can change it however much you want

winged karma
#

Yes, but for some reason it automatically sets the alpha to 0 and it won't allow me to change it through a script

leaden ice
#

Rather than putting a bandaid on it

dusky lake
#

If you are trying to do Graphic.color, Graphic is a unity defined variable, try renaming the reference to the image

winged karma
#

I can get it to change colour no problem, but it automatically becomes transparent

leaden ice
#

You must have an Animator or a script setting it

leaden ice
#

He's trying to do this

#

image.color.a=1

dusky lake
#

oh ok 😄

winged karma
#

When testing I can see that the colour itself has changed, but for some reason alpha gets set to 0 so it isn't visible

leaden ice
#

You'd have to do:

Color c = myImage.color;
c.a = 1;
myImage.color = c;```
winged karma
#

But within the inspector I have it set to 255

leaden ice
#

Otherwise it wouldn't change

winged karma
#

I'm not sure how, since it won't let me change it manually

leaden ice
#

!code

tawny elkBOT
#
Posting code

📃 Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

leaden ice
#

Also it's 0-1 not 0-255

winged karma
#

Yes, that was intentional, but that shouldn't affect the alpha of the canvas itself

leaden ice
#

The canvas itself has no visual appearance

#

It affects all components under the group

#

Including images

winged karma
leaden ice
#

Alpha is part of color yes but it's irrelevant if you're setting the canvas group alpha to 0

winged karma
#

The canvas group alpha is for when I go to do the fade in (in the coroutine that comes after)

indigo drift
#

If I'm making a top-down game, how do I make it so that objects appear in front of the object when the player is behind it and behind the object when the player is in front?
Currently, the player is always in front even when it's not supposed to be

winged karma
#

I think I've realized the problem, the colour that I had set inside the game object (that the canvas colour gets set to at runtime) had its alpha set to 0

#

All fixed, thank you for your help and clarification. Sorry if I'm a bit of a pain sometimes. I appreciate your patience

polar marten
indigo drift
#

So in the first image, when you go in front of it, the object is still drawn on top when it's not supposed to

polar marten
#

your characters should be in the xz plane, standing up, as billboards, with a constraint that aligns them to the camera look vector (-camera.transform.forward)

#

you should not be building your game in xy

#

for a top down view

indigo drift
#

Thas crazy I did Not know you could do that
is there a tutorial

#

Luckily this game is a test so I can just fix that in my actual game

#

I looked up top-down stuff but I didn't find anything

polar marten
#

it's best to always model your game in the unity world as it makes most sense physically / naturalistically

#

2d games aren't physical but they can behave naturalistically

#

so you can give your characters 3d box colliders while being 2d sprites

#

it will make everything easier

indigo drift
# polar marten it will make everything easier

It does sound easier but all the videos I'm finding for how to do it build the game in xy, and I don't have much experience with the camera or 3D space. Do you happen to know any good videos or something I can learn from?

#

actually it might not be that bad I'll just try it

polar marten
#

it's pretty clear

#

unfortunately most youtube videos about unity development are made by people who have shipped 0 games

indigo drift
#

real I learned everything from highschool classes so that about sums up my experience

vagrant harbor
#
using UnityEngine;

public class Move : MonoBehaviour
{
    public float speed = 3f;
    public Transform movePoint;
    public Grid grid;
    public LayerMask whatStopsMovement;

    void Start()
    {
        movePoint.parent = null;      
    }

    void Update()
    {
       
        if (Vector3.Distance(transform.position, movePoint.position) <= 0.1f)
        {
            HandleInput();
        }
         transform.position = Vector3.MoveTowards(transform.position, movePoint.position, speed * Time.deltaTime);
    }

    private void HandleInput()
{
    float horizontalInput = Input.GetAxisRaw("Horizontal");
    float verticalInput = Input.GetAxisRaw("Vertical");

    if (Mathf.Abs(verticalInput) == 1f)
    {
        Vector3 potentialPos = movePoint.position + ConvertToIsometric(new Vector3(0f, verticalInput, 0f));
        if (!IsObstacleInWay(potentialPos))
        {
            movePoint.position = grid.GetCellCenterWorld(grid.WorldToCell(potentialPos));
            Debug.Log(movePoint.position);
        }
    }
    else if (Mathf.Abs(horizontalInput) == 1f)
    {
        Vector3 potentialPos = movePoint.position + ConvertToIsometric(new Vector3(horizontalInput, 0f, 0f));
        if (!IsObstacleInWay(potentialPos))
        {
            movePoint.position = grid.GetCellCenterWorld(grid.WorldToCell(potentialPos));
            Debug.Log(movePoint.position);
        }
    }
}


   private bool IsObstacleInWay(Vector3 potentialPos)
{
    Vector3 currentPos = grid.GetCellCenterWorld(grid.WorldToCell(transform.position));
    Vector3 direction = grid.GetCellCenterWorld(grid.WorldToCell(potentialPos)) - currentPos;
    float distance = Vector3.Distance(currentPos, grid.GetCellCenterWorld(grid.WorldToCell(potentialPos)));
    RaycastHit2D hit = Physics2D.Raycast(currentPos, direction, distance, whatStopsMovement);

    Debug.DrawRay(currentPos, direction, Color.red, 1f);
    return hit;
}

    private Vector3 ConvertToIsometric(Vector3 pos)
    {
        Vector3 isoPos = new Vector3();
        isoPos.x = pos.x - pos.y;
        isoPos.y = (pos.x + pos.y) / 2;
        return isoPos;
    }
}
plain yacht
#

@vagrant harbor A bit to much code for me to debug in my head at this early hour, but what happens if you fire up the debugger and inspect the values as update executes?

vagrant harbor
#

it's alright dw i appreciate the help lol. it might be something obvious that'll come to me when i eat lol. hope you have a good morning:P

normal stump
#

hey so can I create a C# class library that I can share across the game and some other .net project?

rain minnow
normal stump
#

you have any docs on this

#

what about importing a .net standard dll?

#

I can just compile it and import it right?

#

ok great

#

it works

#

thanks anyways

silent canopy
indigo drift
#

Thas crazy I’ll try

silent canopy
indigo drift
#

Okie dokie 👍 I’ll try it and see how it works, thanks

silent canopy
#

And one last thing, make sure you set your sprite sort point to pivot

rain minnow
plain yacht
#

@vagrant harbor Not sure what you're trying to show, but that's not what I meant :). In VS put a breakpoint at the start of your update method and press the "attach to unity" button (looks like a green play button).

#

You might need to move the breakpoint into the parts triggered on a button press though.

potent glade
#

can I change my full screen in a webgl app through the code (I know under the app there's a button to make it go full screen but can I do that through code using screen.fullresolution or is there another way or no way at all)

vague tundra
#

Is there a built-in way of handling combination presses of KeyCodes?

thin aurora
#

And store it each frame I guess, and then check it with an update method

vague tundra
#

Kewl thanks!(: Looks interesting

#

What's the difference between these two lines?

new List<KeyCode>() { KeyCode.LeftShift }

new List<KeyCode> { KeyCode.LeftShift }

thin aurora
#

A list has a paramtererless constructor so you don't need to specify () if you initialise it with predefined values (which in this case is the keycode you added)

#

In your case you could store it in a list like this, and use Enumerable.Contains() on the list to check if the list contains a specific value.

vague tundra
#

Oh yeah alright, awesome:D thanks

grave cape
#

I made a game on unity as a gift for someone so I don't want to publish it. I only want one person to play it. how can he download the game without having access to my computer? It is easy on android but his device is ios.

west lotus
#

Well Im not sure you can even build to ios without a developer account

grave cape
#

I can build to my phone via wired connection. also I activated developer mode on settings

#

I need to make it so I can download wirelessly since the receiver of the project lives in a different country

thin aurora
#

I remember not being able to build a MAUI app because of this exact thing

grave cape
#

chip?

thin aurora
#

An actual Mac is required to compile it in my case, but I have tried looking it up and I can't find it anywhere

#

You can try compiling for IOS and share the error you might get from it?

grave cape
#

I have both a mac and an iphone and I can build and run it perfectly

#

the problem is I want someone cross country to play it

#

on android it is possible with apk

#

how to make someone with an iphone play it cross country

west lotus
#

But I think this might need a paid dev account to work at least I havent tried without one

#

Then again its been a few years since I did ios dev

grave cape
#

this way the app needs to be on app store

#

I cant do that right now

west lotus
#

It doesnt need to be published on the app store

grave cape
#

But it needs to have a page on there therefore it needs an application doesn't it?

mellow sigil
#

no

#

the entire point of Testflight is that people can test the app before it's published

#

but you do need the developer account which is $100/year

west lotus
#

I dont think you can build a “apk” equivalent for ios and send that

grave cape
#

thank for the advice anyways

west lotus
#

Build it for webgl and host it somewhere free

#

Then he can play it on ios from the browser maybe

grave cape
#

that might actually be the thing I am looking for

#

thanks!

plucky inlet
hexed pecan
#

Include the wall's layer in the layermask

#

Otherwise it will be ignored

#

You have it backwards I think

#

If you dont include the wall layer in the mask, the cast will ignore the walls existance

tawny elkBOT
#
Posting code

📃 Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

pale ore
#

hi, i'd like to know if there is a way to get the forward/right vector etc... in world space from an object that is child of another transform, because for now if i rotate the "Pivot" that is the parent object, the child object rotates but it's rotation coords are always the same (0,0,0), so when i try transform.right on the child object, even if the parent rotates it's always stays the same.

hexed pecan
#

I mean, if the boxcast hits a wall, dont attack anything

#

Only attack if it hits the player

dapper flower
# steady moat Use Array.ConvertAll instead
// NotSupportedException: Specified method is not supported.
// System.RuntimeType..ctor () (at <0da48681ced7494d83ae6a612d2206fc>:0)```Moved everything to new lines. Same error, no trace. Also used Array.ConvertAll after
plucky inlet
hexed pecan
#

It returns a Raycasthit2d

#

It has all the data you need

#

You can check if it hit anything by checking if the collider is null

plucky inlet
#

CompareTag for example could help

hexed pecan
#

Yeah check the layer or tag of the hit.collider

#

@slender moon

thin aurora
#

The method requires a string

#

A general value is not gonna work

hexed pecan
#

return true in the if-statement.
return false if it fails (after the if-statement).

plucky inlet
#

Your method is abool but you return a hit

#

return hit.collider != null && yourTagThing;

hexed pecan
#

Yeah you should do the null check on the hit.collider ^

thin aurora
#

return hit?.collider.gameObject.CompareTag("Player") ?? false;
This will ensure the script returns false if nothing was found (and hit will be null)

#

No need for an if-statement

#

hit? returns null, and ?? false will then be called

#

Other than that, normal boolean checking with CompareTag

dapper flower
# plucky inlet can you show the full code, cant find the original one

My project is so complex and so interconnected, it would be impossible to show the full code. The trace points to a line but I don't think the problem is even there. I was hoping for some undocumented piece of knowledge might explain what's happening. I ended up commiting the current state, reverting to the previous commit (4 days ago) and will go piece by piece trying to figure out what happened. Thanks anyway

hexed pecan
#

Yeah because its a struct

thin aurora
#

Oh, right, because it's a value type

hexed pecan
thin aurora
#

You could do return hit != default && hit.collider.gameObject.CompareTag("Player");

thin aurora
hexed pecan
#

Youre the one null checking a struct

thin aurora
hexed pecan
#

Twentacle's answer was fine, idk why over complicate it

thin aurora
hexed pecan
#

Basically

return hit.collider != null && hit.collider.CompareTag("Player");```
hexed pecan
thin aurora
#

return hit.collider?.gameObject.CompareTag("Player") ?? false;
I altered my previous answer by instead checking collider. This will work for you.

muted idol
#

I have lines of code to write characters in TMP input field like this


            hourIF.ActivateInputField();
            hourIF.ProcessEvent(Event.KeyboardEvent("9"));
            hourIF.ForceLabelUpdate();
            hourIF.DeactivateInputField();

but it doesn't work. It works if it's alphabet like hourIF.ProcessEvent(Event.KeyboardEvent("t")); . why is that?

hexed pecan
#

Though im not sure

thin aurora
#

How can they mess that up?

hexed pecan
woeful leaf
#

I think null and ? aren't the same because Unity somehow has overridden null

#

Yeah that

hexed pecan
#

Like a destroyed/missing component

thin aurora
#

Unity being Unity

#

Welp, nevermind then

hexed pecan
#

Yeah that

#

I just generally avoid it so I don't use it with UnityEngine.Object accidentally

woeful leaf
hexed pecan
#

Are you sure the player has the tag "Player"?

thin aurora
#

You should make sure hit.collider returns anything, and if it has the Player tag.

#

Because the code is fine

hexed pecan
#

Make sure youre not mixing up layer name and tag

#

Is the max distance 0?

#

Paste code correctly next time btw. I can barely read that, even the full size image

#

Is the max distance supposed to be 0?

#

@slender moon My bad

#

Didnt realize theres an angle parameter

#

You can always put some Debug.Logs to see what object its hitting, and what layer and tag it has

#

Other than that, the code looks ok, so can't say much

#

If the player has children with colliders, make sure those have the "Player" tag too

#

And correct layer

sleek bough
#

don't put Debug after return, it exits the method at this point

undone star
#

Hey, is having a lot of event listeners too expensive for a webgl build?

#

I keep getting memory access out of bounds inconsistently when loading additive scenes

quartz vessel
#

Hi developers
i am facing this issue and unable to find solution. Anyone have any idea about this?

main shuttle
#

It has examples, open them up?
Also, how is adding a single line in the package manager hard?

honest maple
#

Hello! I am using Unity IAP and want to implement Promotional Offers for auto-renewable subscriptions for the Apple App Store.

I have a signed signature from the server for the promotional offer and I can't for the life of me find documentation for Unity IAP for a method that I can invoke to present the offer/trigger the Apple App Store payment flow. Anyone have an idea?

main shuttle
#

What part of the installation guide you don't understand? 🤔

thin aurora
#

It would have probably given you a choice if you only had to do one

#

First section adds the registery that contains the package, second section actually adds the package locally

misty jewel
#

Hey
How can I avoid looping over all gameobjects with tag (FindGameObjectsWithTag) when selecting an area with mouse?
What if I have 3000 gameobjects with tag and I'm selecting just a few?

main shuttle
misty jewel