Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Lgdn |
in the end of the cutscene of my game the game freeze and close
how to fiw it pls ?
We’re going to need to see code or error messages or something of substance if you want any help. There is absolutely nothing we can do to help you with the information you provided.
timothybrentwood | 2021-07-07 19:23
It might help if you give us the node structure, the error message, and the code!
Snail0259 | 2021-07-10 12:18
hello, sorry for not having answered you, I have several scripts here they are:
title screen :
`extends Button
func _on_Button_pressed():
get_tree().change_scene(“res://Cutscene1.tscn”)`
cutscene :
`extends VideoPlayer
func _on_VideoPlayer_finished():
get_tree().change_scene(“res://Play.tscn”)
pass `
the game :
`extends KinematicBody
const MOVE_SPEED = 110
const JUMP_FORCE = 30
const GRAVITY = 0.98
const MAX_FALL_SPEED = -30
const H_LOOK_SENS = 1.0
const V_LOOK_SENS = 1.0
onready var cam = $CamBase
onready var a1 = $CamBase
onready var mus = $OST/Music
var y_velo = 0
func _input(event):
if event is InputEventMouseMotion:
cam.rotation_degrees.x -= event.relative.y * V_LOOK_SENS
cam.rotation_degrees.x = clamp(cam.rotation_degrees.x,-90,90)
rotation_degrees.y -= event.relative.x * H_LOOK_SENS
func _physics_process(delta):
var move_vec = Vector3()
move_vec.y += 10
if Input.is_action_pressed(“move_right”):
move_vec.x += 1
if Input.is_action_pressed(“move_left”):
move_vec.x -= 1
if Input.is_action_pressed(“move_back”):
move_vec.z += 1
if Input.is_action_pressed(“move_forward”):
move_vec.z -= 1
move_vec = move_vec.normalized()
move_vec = move_vec.rotated(Vector3(0,1,0),rotation.y)
move_vec *= MOVE_SPEED
move_vec.y = y_velo
move_and_slide(move_vec,Vector3(0,1,0))
var grounded = is_on_floor()
y_velo -= GRAVITY
var just_jumped = false
if grounded and Input.is_action_pressed("jump"):
just_jumped = true
y_velo = JUMP_FORCE
if grounded and y_velo <= 0:
y_velo = -.1
if y_velo < MAX_FALL_SPEED:
y_velo = MAX_FALL_SPEED
if Input.is_action_pressed("Reset"):
get_tree().reload_current_scene()
if Input.is_action_pressed("slowmo"):
Engine.time_scale = 0.1
mus.pitch_scale = 0.5
else :
Engine.time_scale = 1
mus.pitch_scale = 1`
Lgdn | 2021-07-22 21:22
hi there is the code
Lgdn | 2021-07-23 16:27