#bullethole issue

1 messages · Page 1 of 1 (latest)

burnt root
#

i am clearly making the glass object the parent

#

if i check what collider i am hitting, it responds "glass"

#

but it spawns the bullethole "one layer above"

#

i didn't have this issue before and i don't know what causes it

#

it just doesn't wanna parent

#

i can't use GetChild(0) because i have objects with multiple glass objects

#

the fact that it creates a glass hole means i hit glass

rustic shoal
#

Can you please provide the script?

#

[]cb

warm cosmosBOT
#

Use codeblocks to send code in a message!

To make a codeblock, surround your code with ```
To use C# syntax highlighting add cs after the three back ticks.

For example:
```cs
Console.WriteLine("Hello World");
```

Produces:

Console.WriteLine("Hello World");

To send lengthy code, paste it into https://paste.myst.rs/ and send the link of the paste into chat.

remote wing
#

^^ please provide the whole script

#

also in your screenshot the glass whole looks like its a child of PushDoor which sounds like the entire door object instead of just the glass sheet

burnt root
remote wing
#

Can you show us how you've configured the collision on the windows and doors

sonic lake
#

All you need is to destroy/disable the bulletholes the moment the glass shatters. You could cache the hole gameobjects the moment they are spawned and when the glass shatters you just loop through the holes and destroy/disable them

#

As a side note, the code could use some cleanup. You are using "GameObject.Find"/Find which is a bad practice and a LOT of GetComponent calls that are kinda confusing when reading and plain unnecrsary if you just use the class instance in the first place.

burnt root
#

and the dor has a probuilder mesh collider

#

there's a hole i can shoot through

#

and in place of that hole is the glass, which uses thr door as a parent