Public collision?

I am trying to hookup a public collision into a trigger

   public Collider CollisionTest;

public void OnTriggerStay(CollisionTest other)
    {

    }
  1. You cannot dictate a particular collider to go into OnTriggerStay. It will pass you the collider your collider is overlapping with.
  2. You seem to have a misunderstanding about how Types, variables, and parameters work in C#. I recommend following some beginner C# tutorials to gain a better understanding of how code is structured. This is a good one: Interactive tutorials - A tour of C# | Microsoft Learn
3 Likes

1, i see… so what does public colliders be used for then?

  1. I know how they work, I have a game on steam and over 20 prototypes, with almost half of them networked. My problem is with networking all the scripts have to be on the parent object, because anywhere else they do not have authority.

Simply using OnTriggerSay as normal does work, but testing shows that there will be problems, one test player 1 died, but for player 3 player 1 was still alive. My idea was, have the bullet script on the player object, put the collider for the bullet into that public, then though a command deal damage, if it is the server, because the server relays everything.

I don’t remember using collider in the way that you meant, but I think that this is used together with their API’s, something like Cast, Distance, IsTouching.

No, you don’t, you have passed the NAME of your variable as a TYPE in a message callback provided by the unity that you can’t change their signature. Someone that knows how it works will not do this kind of error

2 Likes

So because I decided to do some experimenting, it means I 100% do not know how they work?

No, we think you don’t know how C# works, because you presented that code in your OP.

2 Likes

I do know how code works, in fact, I am finishing up an Aircraft controller as we speak that is also networked.

Whoa guys, look out, this guy has code on an aircraft carrier.

Why do you care so much that we think you’re smart? You’re trying to get help, stop trying to impress us at the same time. You do not know how C# works. That is a statement of fact, demonstrated by your original code posted, which tries to do something that has never and will never work in C#. That doesn’t mean you don’t know how any code works, it refers specifically to C#. There may well be programming languages and frameworks where trying something like that would be entirely valid, but C# is not one of them.

Would you rather impress us or would you rather learn how C# works? I’ll tell you right now the former is a lost cause, and I don’t know why you’d care to anyway. But you keep trying to do that, instead of following the good advice from the first reply and actually learning how it works.

2 Likes

I know how C# works, i am using unity to make the carrier, which uses C#. I did an experiment and it failed