SliceInstantiate in transforms can cause problems #37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When you create the newObject, it copies the local position, rotation and scale of the original object, which is all fine, however, if the object itself is inside a transform with a position, rotation or scale that isn't the default one, it can cause some problems. It cam be fixed by simply assigning the same parent to the newObject.
You could argue that it wouldn't be necessary to do that if instead of using local position and rotation you used the global one, however, the scale is still a problem.
I was stuck trying to figure out why the sliced parts teleported through the map and it turned out to be this. I am sure this is a very hacky way of fixing this, but it worked for me, and hey, if it turns out to be a good solution, then perfect!
Leaving that aside, the slicing scripts work like a charm, thanks a lot for writing this!