Having trouble with my gun

i am working on a third person shooter game

Devlogs :-
#Devlog1 Here
#Devlog2 Here
#Devlog3 Here
#Devlog4 Here

in the game players can customize their guns by changing different parts , i used special meshs so i can change the mesh using scripts and rigidconstraints to keep the parts together , but when i tried to make a gun part that have a different mesh and not a retexture that happened … they are not aligned anymore !

i really need your help because i started to lose motivation on making the game , i have been working on the game from 3 months or 2 straight

here is some images :-



thanks for reading.

2 Likes

Why not have pre-made mesh parts stored and then just switching them out?

3 Likes

why not just use weldconstraints? they’re much better for this type of stuff compared to rigidconstraints

2 Likes

i store them as an int value that has the meshid so it use less memory

1 Like

this is not the problem , the problem is with the positioning of the parts

1 Like

try aligning the custom model with the default one the best you can. use 0.005 or similar.

1 Like

Mesh parts use barely any memory, no need to over optimize your game.

2 Likes

i thought about that but this will make me adjust every gun part manually

how this can help fixing the issue ?

This would help by making you use mesh parts instead of special meshes, also the fact that mesh parts can be positioned much better so you would basically just need to copy the initial position of the mesh and then interchange welds and positions and size etc. It’s kind of much accurate and easier than special meshes.

1 Like

I agree with @awry_y here. Using already built meshes and just switching them out, using transparency property, it would make the system allot more simple and prevent issues like these to appear. I don’t know if memory is a huge issue, but it is generally better to keep your systems as simple as possible.

1 Like

so how can this fix the positioning issue , even if the gun parts are pre made meshs they will still have issues with positioning

this is crazy , have all the parts already in the gun model may cause a lot of lag

i tried to position them manually but this did not work either , like this i will need to position every part for every other part (like the default chamber needs to have a different position for every reloading port)

You can position them manually? Like using the position property or by using weld (not weld constraints) and editing c0.

1 Like

this will not work i already tried that and it turned out that i will need to position every part a different position for every another part

You would have to do that for using special meshes as well. Orr, you can use

this users advice. Using the transparency property will keep everything optimized and you won’t even have to position anything at all!

1 Like

this will not work either , here is how :- lets say we have the front part and the middle part , if the player decided to change the front part it may be aligned well or not because the middle part may need a special positing it self so this means that i will need to make copies of that part and every copy match a certain part only

No no no, not really like that.

So basically, you make all the parts and have them welded plus parented to the gun, then when you want to change something, you make the old parts transparent and the new parts visible This won’t need any positioning at all.

1 Like

Can you give me that model for free once you’re done with it please?