Files
maplecontest/RootDesk/MyDesk/MapCamera.codeblock
gahusb f1d101f6a4 feat(map-camera): 게임 시작 시 플레이어 입력 차단·오른쪽 바라보기 + map01 몬스터 3마리 배치
MapCamera 스크립트(맵 진입 OnBeginPlay)가 카메라에 더해 플레이어도 셋업:
- PlayerControllerComponent.LookDirectionX=1 (오른쪽 — 기본은 -1 왼쪽)
- FixedLookAt=true (방향 고정)
- Enable=false (키보드 입력 차단: 이동/점프/공격)
- map01: 몬스터 3마리 배치(사용자 의도 변경 포함)
- 메이커 Play 검증: LookDirectionX=1·Enable=false 확인, 오른쪽키 입력→플레이어 미이동(입력 차단), 아바타 정상, 카메라 zoom90·offset(1.5,-1) 유지

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 23:35:58 +09:00

60 lines
2.1 KiB
Plaintext

{
"Id": "",
"GameId": "",
"EntryKey": "codeblock://mapcamera",
"ContentType": "x-mod/codeblock",
"Content": "",
"Usage": 0,
"UsePublish": 1,
"UseService": 0,
"CoreVersion": "26.5.0.0",
"StudioVersion": "",
"DynamicLoading": 0,
"ContentProto": {
"Use": "Json",
"Json": {
"CoreVersion": {
"Major": 0,
"Minor": 2
},
"ScriptVersion": {
"Major": 1,
"Minor": 0
},
"Description": "",
"Id": "MapCamera",
"Language": 1,
"Name": "MapCamera",
"Type": 1,
"Source": 0,
"Target": null,
"Properties": [
{
"Type": "number",
"DefaultValue": "0",
"SyncDirection": 0,
"Attributes": [],
"Name": "CamTries"
}
],
"Methods": [
{
"Return": {
"Type": "void",
"DefaultValue": null,
"SyncDirection": 0,
"Attributes": [],
"Name": null
},
"Arguments": [],
"Code": "self.CamTries = 0\nlocal eventId = 0\nlocal function apply()\n\tself.CamTries = self.CamTries + 1\n\tlocal cam = nil\n\tlocal lp = _UserService.LocalPlayer\n\tif lp ~= nil then\n\t\tcam = lp.CameraComponent\n\tend\n\tif cam == nil then\n\t\tcam = _CameraService:GetCurrentCameraComponent()\n\tend\n\tif cam ~= nil then\n\t\tcam.ZoomRatio = 90\n\t\tcam.ScreenOffset = Vector2(0.5, 0.655)\n\t\tcam.ConfineCameraArea = true\n\t\tcam.CameraOffset = Vector2(1.5, -1)\n\tend\n\tlocal pc = nil\n\tif lp ~= nil then\n\t\tpc = lp.PlayerControllerComponent\n\t\tif pc ~= nil then\n\t\t\tpc.LookDirectionX = 1\n\t\t\tpc.FixedLookAt = true\n\t\t\tpc.Enable = false\n\t\tend\n\tend\n\tif cam ~= nil and pc ~= nil then\n\t\t_TimerService:ClearTimer(eventId)\n\telseif self.CamTries > 30 then\n\t\t_TimerService:ClearTimer(eventId)\n\tend\nend\neventId = _TimerService:SetTimerRepeat(apply, 0.1)",
"Scope": 2,
"ExecSpace": 6,
"Attributes": [],
"Name": "OnBeginPlay"
}
],
"EntityEventHandlers": []
}
}
}