Unity – using Colliders with custom objects

Hi so I’m quite new to Unity and currently experiencing issues with colliders, a quick summary of what I have.

Player >

Object = Capsule ( Directly created through Unity ) Components = CharacterController, CapsuleCollider & a PlayerController script 

Basic Tile >

Object = Rectangle ( Imported from blender ) Components = BoxCollider 

this combination works well, no issues. However when I get to slightly more complex objects, such as elevated terrain I can’t apply a box collider because the surface isn’t flat. So my next thought was to add a Mesh Collider but unfortunately it doesn’t seem to do anything effective ( my player falls through ) I don’t know whether that’s because Mesh Colliders are only relevant to RigidBodies? Unfortunately though I can’t switch from a CharacterController to a RigidBody.

So I’m not sure what to do, maybe MeshColliders are reponsive to a CharacterController and my settings aren’t adjusted correctly?

What is the initiative of the objects animated by the Animate Objects spell?

The Animate Objects spell indicates that the objects act on their turn, but it doesn’t explicitly state what their initiative is. Are they supposed to roll initiative using their Dex modifiers (either individually or with their size class)? This would be as in the Find Familiar spell:

In combat, it rolls its own initiative and acts on its own turn.

Or do they act immediately after the caster? This would be as in the Summon Beast spell:

In combat, the creature shares your initiative count, but it takes its turn immediately after yours.

Or does this simply require a decision by the DM?

Damaging inanimate objects in battles to indirectly gain advantage in battles

  1. I was thinking of using Spell damage to knockdown a dead Tree trunk in order for it to land on two/three skeletons and therefore pinning them effectively in place.

  2. Assuming having 1 Torch lit only with an all-human party (and I am Chaotic Evil), I was thinking of aiming my spell on the Torch effectively putting it out and make my quick getaway.

Are these possible scenarios?

This is for the Table Top game Dungeons and Dragons (DnD-e5). (sorry about that)

How much XP does a monster created by Animate Objects add to an encounter?

I am making a boss fight. The boss can cast animate objects, a spell that can animate statues.

The spell gives information for, eg., 1 Large Construct:

Large – HP: 50, AC: 10, Attack: +6 to hit, 2d10 + 2 damage, Str: 14, Dex: 10

How much XP should I award for this Large construct?

I’m estimating CR1 (200XP) each.

Detect collisions for each instantiated objects

I want to instantiate cube at a random position when I click mouse and do something (change color or freeze position ..) for each cube when detect collision on the plane.

I tried first few steps:

public Rigidbody cube;  void OnCollisionEnter(Collision collision) {     if (collision.gameObject.name == "Plane")     {         //Do somthing for each cube         cube.constraints = RigidbodyConstraints.FreezePositionY;     } }  void Update() {     Vector3 position = new Vector3(Random.Range(-5f, 5f), 8,Random.Range(-5, 5));      if (Input.GetMouseButtonDown(0))     {         Rigidbody clone;         clone = Instantiate(cube,position, Quaternion.identity);     } } 

Mirror Networking; Scene’s network objects are disabled when building server separately

if one of the clients is also the server then this situation does not happen and networked scene objects are visible. But when building the server separately and then when a client is connected, all the network objects are disabled. I have read the documentation but still can’t figure it out. I am loading the level scene additively. Here is the related documantation and link :
https://mirror-networking.com/docs/Articles/Components/NetworkIdentity.html https://mirror-networking.com/docs/Articles/Guides/Visibility.html

Scene-based Network Game Objects

You can also network game objects that are saved as part of your Scene (for example, environmental props). Networking game objects makes them behave slightly differently, because you need to have them spawn across the network. When building your game, Unity disables all Scene-based game objects with Network Identity components. When a client connects to the server, the server sends spawn messages to tell the client which Scene game objects to enable and what their most up-to-date state information is. This ensures the client’s game does not contain game objects at incorrect locations when they start playing, or that Unity does not spawn and immediately destroy game objects on connection (for example, if an event removed the game object before that client connected). See Networked Scene Game Objects for more information.

Network Visibility

Multiplayer games use the concept of network visibility to determine which players can see which game objects at any given time during game play. In a game that has a moving viewpoint and moving game objects, it’s common that players cannot see everything that is happening in the game at once. If a particular player, at a certain point in time during game play, cannot see most of the other players, non-player characters, or other moving or interactive things in your game, there is usually no need for the server to send information about those things to the player’s client. This can benefit your game in two ways:

  1. It reduces the amount of data sent across the network between players. This can help improve the responsiveness of your game, and reduce bandwidth use. The bigger and more complex your multiplayer game, the more important this issue is.
  2. It also helps prevent some cheating. Since a player client does not have information about things that can’t be seen, a hack on that player’s computer cannot reveal the information.

The idea of “visibility” in the context of networking doesn’t necessarily relate to whether game objects are directly visible on-screen. Instead, it relates to whether data should or shouldn’t be sent about the game object in question to a particular client. Put simply, if a client can’t ‘see’ an game object, it does not need to be sent information about that game object across the network. Ideally you want to limit the amount of data you are sending across the network to only what is necessary, because sending large amounts of unnecessary data across the network can cause network performance problems. However, it can be also be resource intensive or complex to determine accurately whether a game object truly visible to a given player, so it’s often a good idea to use a more simple calculation for the purposes of determining whether a player should be sent networked data about it – i.e. whether it is ‘Network Visible’. The balance you want to achieve when considering this is between the cost of the complexity of the calculation for determining the visibility, and the cost of sending more information than necessary over the network. A very simple way to calculate this is a distance (proximity) check, and Mirror provides a built-in component for this purpose.

For dynamically batched objects the `unity_ObjectToWorld` shader variable is always set to default?

I’m using the standard render pipeline and the unity_ObjectToWorld variable for some calculations in my shader. After I enabled dynamic batching these calculations got broken. It seems that unity_ObjectToWorld is set to default when the objects are being batched. Is it by design? I didn’t find anything in the documentation.

What size category are weapons if brought to life with the “Animate Objects” Spell?

A wizard at my table wants to use weapons (greatswords) for his Animate Objects spell. Do i take the weapons base damage and match it with the table of Animate Objects (2D6 making them Medium), or are there any rules i may have missed pertaining to the object-size of weapons?

Any clarification, or your own interpretation (if its up to DM’s) would be most welcome.

EDIT: After all your great informative input, I’m going with the following:

  • Weapons weighing 1 lb. or less as Tiny (daggers, darts and ammunition)
  • Heavy Weapons as Medium (glaive, greataxe, greatsword, halbert, maul, pike and h-crossbow)
  • All other Weapons as Small (unless indicated otherwise, oversized for example)