As the title dictates, I need to position a part relative to two factors, an origin and where it is relative to.
.
If some people are aware of the mesh bug, where you can emulate the very same effect by inversing a mesh’s normals, this gave birth to the trend of these UGC crations:
Of course, now it is pretty simple to do for a part, you can just inverse a part’s rotation matrix, and add a smaller part inside and it would look something like this:
So what’s the issue? Well this is the issue!
The blue outline isn’t hidden when the inner part is intersecting the outer and why this is an issue is that it makes it difficult to stack these parts together.
I am no good with math! Although, I’d guess the logic would be look something like whitePart.CFrame = CFrame.new(bluePart.Position * Camera.CFrame.LookVector * Camera.CFrame.Position) ← Obviously not going to work
For people interested of its use-case, I am currently making a custom lightning module with TypeScript and it looks something like this
You seem to make the problem harder than it is. The direction to move the part from the base part’s position is just the camera’s LookVector. Have the inverted object spawn, like you do now, at the base part’s origin. Then, bound to RenderStepped, move the part a few units in the the direction of:
Yeah, there’s not much I can go off of based on a video unfortunately. But in concept, your lightning movements plus a render stepped second-pass movement would be expensive on it. You’d definitely need to integrate it into the first-pass (what causes the lightning to spawn and move in the first place) to avoid double-dipping on the rendering.
Unfortunately I can’t help further without code or a reproduction.