inheritance is hard
This commit is contained in:
13
Examples/mvp-walk-with-collision/Entities/Characters/character.gd
Executable file → Normal file
13
Examples/mvp-walk-with-collision/Entities/Characters/character.gd
Executable file → Normal file
@@ -1,8 +1,13 @@
|
||||
extends PhysicsBody3D
|
||||
|
||||
var mover = new("res://Entities/Characters/Movers/pedal.gd")
|
||||
var mover := preload("res://Entities/Characters/Movers/pedal.gd").new()
|
||||
|
||||
func _physics_process(delta: float):
|
||||
duo = self.mover.to_move_rotate(delta)
|
||||
velocity = duo[0]
|
||||
move_and_slide()
|
||||
var duo = self.mover.to_move_rotate(self.global_transform, delta)
|
||||
self._physics_process_with(duo[0], duo[1])
|
||||
|
||||
func _physics_process_with(vel, rot):
|
||||
self.velocity = vel
|
||||
self.rotate_object_local(Vector3.UP, rot)
|
||||
print("vel", vel)
|
||||
self.move_and_collide(self.velocity)
|
||||
|
||||
Reference in New Issue
Block a user