MovementScript - Snow1226/CameraPlus GitHub Wiki
Movement Script
The sample script described in MovementScriptPath is located in the "Beat Saber\UserData\CameraPlus\Scripts" folder. MovementScriptPath must be "filename + extension json".
Note
Due to the change in path control, even if you write the full path, it will refer to the "Beat Saber\UserData\CameraPlus\Scripts" folder.
This is a countermeasure for SongScript support and unnecessary access when changing the profile. please note that.
ex)
movementScriptpath = "ExampleMovementScript.json"
Users of regions that use commas for the decimal point
By definition in the JSON file, the decimal point must use a dot.
If you really want to use a comma for the decimal point, enclose the number in double quotes. Encode on the CameraPlus side.
ex)
- default [ "y" : 1.75, ]
- double quotes [ "y" : "1,75", ]
About the description content
Since there is a comment for explanation, it will not work even if you copy the following.
A sample script with the same content is generated when CameraPlus is started.
{
"ActiveInPauseMenu": true, //"ActiveInPauseMenu": Determines whether the camera pauses when pausing the game.
"TurnToHeadUseCameraSetting": false,
//"TurnToHeadUseCameraSetting"
: If the setting to point the camera at the HMD is true, match it with the camera body.
If false, use the value in the Movements section.
"Movements": [ //"Movements" : Position description section of the moving camera.
{
"StartPos": { //"StartPos" : Camera start position (the center of the play area is 0,0,0).
"x": 2,
"y": 1.75,
"z": -2,
"FOV": 90 //"FOV" : (Optional) StartFOV
},
"StartRot": { //"StartRot" : The rotation at which the camera starts (0,0,0 looks straight at the main menu).
"x": 15,
"y": -15,
"z": 0
},
"StartHeadOffset": { //"StartHeadOffset" : (Optional) Only when TurnToHead or TurnToHeadUseCameraSetting is enabled
"x": 0, Offset when pointing the camera towards the HMD(the center of the HMD is 0,0,0).
"y": 0,
"z": 0
},
"EndPos": { //"EndPos" : The position where the camera ends.
"x": 2,
"y": 1,
"z": 9,
"FOV": 40 //"FOV" : (Optional) EndFOV
},
"EndRot": { //"EndRot" : The rotation at which the camera ends.
"x": 15,
"y": -40,
"z": 0
},
"EndHeadOffset": { //"EndHeadOffset" : (Optional) Only when TurnToHead or TurnToHeadUseCameraSetting is enabled
"x": 0, Offset when pointing the camera towards the HMD(the center of the HMD is 0,0,0).
"y": 0,
"z": 0
},
"CameraEffect":{
"enableDoF": false,
"dofAutoDistance": false,
"StartDoF": {
"dofFocusDistance": 1.0,
"dofFocusRange": 1.0,
"dofBlurRadius": 5.0
},
"EndDoF": {
"dofFocusDistance": 1.0,
"dofFocusRange": 1.0,
"dofBlurRadius": 5.0
},
"wipeType": "Circle",
"StartWipe": {
"wipeProgress": 0.0,
"wipeCircleCenter": {
"x": 0.0,
"y": 0.0
}
},
"EndWipe": {
"wipeProgress": 0.0,
"wipeCircleCenter": {
"x": 0.0,
"y": 0.0
}
},
"enableOutlineEffect": false,
"StartOutlineEffect": {
"outlineEffectOnly": 0.0,
"outlineColor":{
"r": 0.0,
"g": 0.0,
"b": 0.0
},
"outlineBackgroundColor":{
"r": 0.0,
"g": 0.0,
"b": 0.0
}
},
"EndOutlineEffect": {
"outlineEffectOnly": 0.0,
"outlineColor":{
"r": 0.0,
"g": 0.0,
"b": 0.0
},
"outlineBackgroundColor":{
"r": 0.0,
"g": 0.0,
"b": 0.0
}
}
},
"TurnToHead": false, //"TurnToHead" : If true, this section will point the camera at the HMD.
"TurnToHeadHorizontal": false,
//"TurnToHeadHorizontal"
: Limit TurnToHead to horizontal rotation only.
"Duration": 4, //"Duration" : The time it takes for the transition to start / end / rotate.
"Delay": 0, //"Delay" : the time to wait before proceeding to the next move.
"VisibleObject": {
"avatar": true, //"avatar" : (Optional) Hide the target object in this section.
"ui": true, //"ui : (Optional) Hide the target object in this section.
"wall" : false, //"wall" : (Optional) Hide the target object in this section.
"wallFrame" : true, //"wallFrame" : (Optional) Hide the target object in this section.
"saber" : true, //"saber" : (Optional) Hide the target object in this section.
"notes" : true, //"notes" : (Optional) Hide the target object in this section.
"debris" : false //"debris" : (Optional) Hide the target object in this section.
},
"EaseTransition": true //"EaseTransition" : If false, the transition between start / end will be linear. Otherwise, the transition is slower from the beginning to the end and faster.
}
]
}
FAQ
Q1. The sample script does not work.
A1. If the old sample script remains
The correct one is not generated.
In the past, scripts that didn't work without uncommenting or scripts with typo were sometimes attached.
Sorry to trouble you, but if you delete the sample script once and start the game again, the correct one will be generated.
Q2. Doesn't work
A2. I think it's a syntax mistake.
Beat Saber/Logs/CameraPlus/_latest.log
If you look at, there is a high possibility that a syntax error is described.
Q3. It worked in previous versions, but it stopped working.
A3. I think it's a syntax mistake.
Since v4.5.0, the JSON conversion library has been adapted to the game.
Therefore, the syntax check is strict.
Rather, it is abnormal that it was working before.
Q4. No error, but it doesn't work
A4. If you want to operate on the menu screen, you need to use the Unity timer. Please change the setting.
Checked the above, but it doesn't work.
Please contact us from the Issue page.
At that time,
- Is the dot or comma used for the decimal point?
- Log when it doesn't work.
- Scripts that don't work.
Please specify the above three points.