PoppingPopper
PoppingPopper
Explore posts from servers
Rroblox-ts
Created by PoppingPopper on 5/25/2025 in #help
Why is my model only rotating it's primary part?
No way, I did not know about this class. Thank you so much for your help. It's working.
33 replies
Rroblox-ts
Created by PoppingPopper on 5/25/2025 in #help
Why is my model only rotating it's primary part?
I don't know what "WorldModel" is
33 replies
Rroblox-ts
Created by PoppingPopper on 5/25/2025 in #help
Why is my model only rotating it's primary part?
My character is in my viewport yes, it is not in the viewportFrame
33 replies
Rroblox-ts
Created by PoppingPopper on 5/25/2025 in #help
Why is my model only rotating it's primary part?
33 replies
Rroblox-ts
Created by PoppingPopper on 5/25/2025 in #help
Why is my model only rotating it's primary part?
May I ask why?
33 replies
Rroblox-ts
Created by PoppingPopper on 5/25/2025 in #help
Why is my model only rotating it's primary part?
const thread = task.spawn(() => {
// eslint-disable-next-line no-constant-condition
while (true) {
task.wait(1);
previewModelClone.PivotTo(new CFrame(0, 2, 0));
task.wait(1);
previewModelClone.PivotTo(new CFrame(0, 0, 0));
}
});
const thread = task.spawn(() => {
// eslint-disable-next-line no-constant-condition
while (true) {
task.wait(1);
previewModelClone.PivotTo(new CFrame(0, 2, 0));
task.wait(1);
previewModelClone.PivotTo(new CFrame(0, 0, 0));
}
});
33 replies
Rroblox-ts
Created by PoppingPopper on 5/25/2025 in #help
Why is my model only rotating it's primary part?
How do I use PivotTo in a tween? Or are you asking me to test?
33 replies
Rroblox-ts
Created by PoppingPopper on 5/25/2025 in #help
Why is my model only rotating it's primary part?
If that's involved with the tween.
33 replies
Rroblox-ts
Created by PoppingPopper on 5/25/2025 in #help
Why is my model only rotating it's primary part?
I feel like this has to do with the viewport frame, maybe it doesn't enforce certain physics
33 replies
Rroblox-ts
Created by PoppingPopper on 5/25/2025 in #help
Why is my model only rotating it's primary part?
Only the primary part is anchored ✅
33 replies
Rroblox-ts
Created by PoppingPopper on 5/25/2025 in #help
Why is my model only rotating it's primary part?
I'm pretty sure, I mean even if only certain things were welded to it, those should at least be rotating.
33 replies
Rroblox-ts
Created by PoppingPopper on 11/3/2024 in #help
Source and destination must not be the same
I can manually get it to work if I hardcode the dest path lol!
33 replies
Rroblox-ts
Created by PoppingPopper on 11/3/2024 in #help
Source and destination must not be the same
It's a folder
33 replies
Rroblox-ts
Created by PoppingPopper on 11/3/2024 in #help
Source and destination must not be the same
{
"compilerOptions": {
// required
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"jsx": "react",
"jsxFactory": "Roact.createElement",
"jsxFragmentFactory": "Roact.createFragment",
"module": "commonjs",
"moduleResolution": "Node",
"noLib": true,
"resolveJsonModule": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"moduleDetection": "force",
"strict": true,
"target": "ESNext",
"typeRoots": ["node_modules/@rbxts", "node_modules/@flamework"],

// configurable
"rootDir": "src",
"outDir": "out",
"baseUrl": "src",
"incremental": true,
"tsBuildInfoFile": "out/tsconfig.tsbuildinfo",

"plugins": [{ "transform": "rbxts-transformer-flamework" }]
}
}
{
"compilerOptions": {
// required
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"jsx": "react",
"jsxFactory": "Roact.createElement",
"jsxFragmentFactory": "Roact.createFragment",
"module": "commonjs",
"moduleResolution": "Node",
"noLib": true,
"resolveJsonModule": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"moduleDetection": "force",
"strict": true,
"target": "ESNext",
"typeRoots": ["node_modules/@rbxts", "node_modules/@flamework"],

// configurable
"rootDir": "src",
"outDir": "out",
"baseUrl": "src",
"incremental": true,
"tsBuildInfoFile": "out/tsconfig.tsbuildinfo",

"plugins": [{ "transform": "rbxts-transformer-flamework" }]
}
}
33 replies
Rroblox-ts
Created by PoppingPopper on 11/3/2024 in #help
Source and destination must not be the same
Looks like there is a weird thing going on here I printed it out differently
function copyItem(data, pathTranslator, item) {
console.log("DEBUG START")
console.log("src: " + item)
console.log("dest: " + pathTranslator.getOutputPath(item))
console.log("DEBUG END")
fs_extra_1.default.copySync(item, pathTranslator.getOutputPath(item), {
function copyItem(data, pathTranslator, item) {
console.log("DEBUG START")
console.log("src: " + item)
console.log("dest: " + pathTranslator.getOutputPath(item))
console.log("DEBUG END")
fs_extra_1.default.copySync(item, pathTranslator.getOutputPath(item), {
DEBUG START
src: /Users/foouser/Desktop/roblox-test-project/src
dest: /Users/foouser/Desktop/roblox-test-project/src
DEBUG END
DEBUG START
src: /Users/foouser/Desktop/roblox-test-project/src
dest: /Users/foouser/Desktop/roblox-test-project/src
DEBUG END
Shouldn't dest have gone to /out?
33 replies
Rroblox-ts
Created by PoppingPopper on 11/3/2024 in #help
Source and destination must not be the same
No description
33 replies
Rroblox-ts
Created by PoppingPopper on 1/24/2025 in #help
Weird jittering when moving model over terrain
Ohhhhhh I see, so it appears I didn't add filtering to the ray. I noticed that it worked after I set CanQuery to false like you said. After setting some RaycastParams and filtering out itself it worked! Thank you so much sir!
11 replies
Rroblox-ts
Created by PoppingPopper on 1/24/2025 in #help
Weird jittering when moving model over terrain
Amazing! I will implement this.
11 replies
Rroblox-ts
Created by PoppingPopper on 1/24/2025 in #help
Weird jittering when moving model over terrain
Yes, not the others though. I'll try turning them all off.
11 replies
Rroblox-ts
Created by PoppingPopper on 1/24/2025 in #help
Weird jittering when moving model over terrain
Full code if needed
import { Controller, OnRender } from "@flamework/core";
import { Players, Workspace } from "@rbxts/services";
import { t } from "@rbxts/t";
import { MAX_BUILD_RANGE } from "shared/constants/player-constants";
import { transparentify } from "shared/module";

interface PreviewModel extends Model {
RootPart: BasePart;
}

const localPlayer = Players.LocalPlayer;
const mouse = localPlayer.GetMouse();

@Controller({})
export class ShadowBuildPreview implements OnRender {
private previewModel: PreviewModel | undefined;

onRender() {
const character = localPlayer.Character;
if (!character) return;

const [center] = character.GetBoundingBox();

if (!this.previewModel) return;
const mousePosition = mouse.Hit.Position;
const rootPart = this.previewModel.RootPart;
const sizeOffset = new Vector3(0, rootPart.Size.Y / 2, 0);
let targetPosition = mousePosition.add(sizeOffset);

const distance = targetPosition.sub(center.Position).Magnitude;
if (distance > MAX_BUILD_RANGE) {
const direction = targetPosition.sub(center.Position).Unit;
targetPosition = center.Position.add(direction.mul(50));
}

const ray = new Ray(targetPosition, new Vector3(0, -1000, 0));
const raycastResult = Workspace.Raycast(ray.Origin, ray.Direction);

if (raycastResult) {
targetPosition = raycastResult.Position.add(sizeOffset);
}

this.previewModel.PivotTo(new CFrame(targetPosition));
}

public setPreviewModel(model: Model) {
const previewModel = model.Clone();
if (!isPreviewModel(previewModel))
return error(
`<ShadowBuildPreview.setPreviewModel()> Invalid preview model, RootPart could not be validated`,
);

this.previewModel = previewModel.Clone();
transparentify(this.previewModel, {
transparency: 0.6,
canCollide: false,
blacklist: [this.previewModel.RootPart],
});
this.previewModel.Parent = Workspace;
mouse.TargetFilter = this.previewModel;
}

public removePreviewModel() {
if (!this.previewModel) return;
this.previewModel.Destroy();
this.previewModel = undefined;
}

public getTargetCFrame() {
return this.previewModel?.PrimaryPart?.CFrame;
}
}

const IPreviewModel = t.interface({
RootPart: t.instanceIsA("BasePart"),
});

function isPreviewModel(value: Instance): value is PreviewModel {
const record: Record<string, Instance> = {};
for (const child of value.GetChildren()) {
record[child.Name] = child;
}
return IPreviewModel(record);
}
import { Controller, OnRender } from "@flamework/core";
import { Players, Workspace } from "@rbxts/services";
import { t } from "@rbxts/t";
import { MAX_BUILD_RANGE } from "shared/constants/player-constants";
import { transparentify } from "shared/module";

interface PreviewModel extends Model {
RootPart: BasePart;
}

const localPlayer = Players.LocalPlayer;
const mouse = localPlayer.GetMouse();

@Controller({})
export class ShadowBuildPreview implements OnRender {
private previewModel: PreviewModel | undefined;

onRender() {
const character = localPlayer.Character;
if (!character) return;

const [center] = character.GetBoundingBox();

if (!this.previewModel) return;
const mousePosition = mouse.Hit.Position;
const rootPart = this.previewModel.RootPart;
const sizeOffset = new Vector3(0, rootPart.Size.Y / 2, 0);
let targetPosition = mousePosition.add(sizeOffset);

const distance = targetPosition.sub(center.Position).Magnitude;
if (distance > MAX_BUILD_RANGE) {
const direction = targetPosition.sub(center.Position).Unit;
targetPosition = center.Position.add(direction.mul(50));
}

const ray = new Ray(targetPosition, new Vector3(0, -1000, 0));
const raycastResult = Workspace.Raycast(ray.Origin, ray.Direction);

if (raycastResult) {
targetPosition = raycastResult.Position.add(sizeOffset);
}

this.previewModel.PivotTo(new CFrame(targetPosition));
}

public setPreviewModel(model: Model) {
const previewModel = model.Clone();
if (!isPreviewModel(previewModel))
return error(
`<ShadowBuildPreview.setPreviewModel()> Invalid preview model, RootPart could not be validated`,
);

this.previewModel = previewModel.Clone();
transparentify(this.previewModel, {
transparency: 0.6,
canCollide: false,
blacklist: [this.previewModel.RootPart],
});
this.previewModel.Parent = Workspace;
mouse.TargetFilter = this.previewModel;
}

public removePreviewModel() {
if (!this.previewModel) return;
this.previewModel.Destroy();
this.previewModel = undefined;
}

public getTargetCFrame() {
return this.previewModel?.PrimaryPart?.CFrame;
}
}

const IPreviewModel = t.interface({
RootPart: t.instanceIsA("BasePart"),
});

function isPreviewModel(value: Instance): value is PreviewModel {
const record: Record<string, Instance> = {};
for (const child of value.GetChildren()) {
record[child.Name] = child;
}
return IPreviewModel(record);
}
11 replies