Compare commits
2 Commits
aceb61601d
...
6e6c8e00bd
| Author | SHA1 | Date | |
|---|---|---|---|
| 6e6c8e00bd | |||
| 4daac08062 |
57
CLAUDE.md
57
CLAUDE.md
@@ -62,6 +62,63 @@ part.Parent = game.Workspace
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## 🚨 중요 개발 노트 (반드시 숙지!)
|
||||||
|
|
||||||
|
### ❌ LocalScript 물리 엔진 제약사항
|
||||||
|
|
||||||
|
**문제**: LocalScript에서 BodyVelocity/BodyGyro를 생성하면 클라이언트에서만 보이고 실제 물리 엔진에 영향을 주지 못함
|
||||||
|
|
||||||
|
**증상**:
|
||||||
|
- Output 창에 "✅ BodyVelocity 생성" 메시지는 나오지만
|
||||||
|
- 실제로 `workspace.RaceCar1.Chassis:FindFirstChildOfClass("BodyVelocity")`는 nil 반환
|
||||||
|
- `bodyVelocity.Velocity` 설정해도 차량이 움직이지 않음
|
||||||
|
- 키 입력은 감지되고 속도 계산은 정상이지만 이동 없음
|
||||||
|
|
||||||
|
**원인**:
|
||||||
|
- LocalScript는 클라이언트 전용이므로 서버에 물리 오브젝트를 생성할 수 없음
|
||||||
|
- BodyVelocity/BodyGyro는 서버에서만 작동하는 물리 엔진 컴포넌트
|
||||||
|
|
||||||
|
**해결책**:
|
||||||
|
```lua
|
||||||
|
-- ❌ 작동하지 않음 (LocalScript)
|
||||||
|
local bodyVel = Instance.new("BodyVelocity")
|
||||||
|
bodyVel.Parent = chassis
|
||||||
|
bodyVel.Velocity = moveDirection -- 효과 없음!
|
||||||
|
|
||||||
|
-- ✅ 올바른 방법 (LocalScript)
|
||||||
|
chassis.AssemblyLinearVelocity = moveDirection -- 직접 설정
|
||||||
|
chassis.CFrame = chassis.CFrame * CFrame.Angles(0, rotation, 0) -- 회전
|
||||||
|
```
|
||||||
|
|
||||||
|
**추가 제약**:
|
||||||
|
- `SetNetworkOwner()` - LocalScript에서 호출 불가 (서버 전용 API)
|
||||||
|
- `BodyGyro`, `BodyPosition`, `BodyForce` 등 모든 Body* 계열 동일한 문제
|
||||||
|
|
||||||
|
### ✅ Roblox 최신 물리 엔진 권장 사항
|
||||||
|
|
||||||
|
**최신 방식**: AssemblyLinearVelocity/AssemblyAngularVelocity 직접 사용
|
||||||
|
- LocalScript/Script 모두에서 작동
|
||||||
|
- 더 빠르고 효율적
|
||||||
|
- Body* 계열보다 예측 가능
|
||||||
|
|
||||||
|
**참고 코드**:
|
||||||
|
```lua
|
||||||
|
-- 속도 설정
|
||||||
|
chassis.AssemblyLinearVelocity = chassis.CFrame.LookVector * speed
|
||||||
|
|
||||||
|
-- 회전
|
||||||
|
chassis.CFrame = chassis.CFrame * CFrame.Angles(0, math.rad(turnSpeed), 0)
|
||||||
|
|
||||||
|
-- 물리 속성 조정 (선택사항)
|
||||||
|
chassis.CustomPhysicalProperties = PhysicalProperties.new(
|
||||||
|
0.7, -- Density
|
||||||
|
0.3, -- Friction
|
||||||
|
0.5 -- Elasticity
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
# 📋 프로젝트 개요
|
# 📋 프로젝트 개요
|
||||||
|
|
||||||
- **플랫폼**: Roblox Studio
|
- **플랫폼**: Roblox Studio
|
||||||
|
|||||||
Binary file not shown.
1
run_claude.bat
Normal file
1
run_claude.bat
Normal file
@@ -0,0 +1 @@
|
|||||||
|
claude --dangerously-skip-permissions
|
||||||
Reference in New Issue
Block a user