iorewgiga.blogg.se

Mtasa get player target
Mtasa get player target









mtasa get player target

If Input.is_action_pressed("strafe_left"):Įlif Input.is_action_pressed("strafe_right"): If Input.is_action_pressed("move_forward"):Įlif Input.is_action_pressed("move_back"): Var head_basis = head.get_global_transform().basis If Input.is_action_just_pressed("ui_cancel"): If camera_x_rotation + x_delta > -90 and camera_x_rotation + x_delta < 90: Head.rotate_y(deg2rad( * mouse_sensitivity)) Get_tree().call_group("zombies", "set_player", self) Onready var raycast = $Head/Camera/Ra圜ast Onready var anim_player = $Head/Camera/AnimationPlayer I'm really not sure what the problem is so I'll include the Player script here too for reference: extends KinematicBody Move_and_slide(direction * speed * delta, Vector3.UP)

mtasa get player target mtasa get player target

Var direction = ( - transform.origin).normalized() If coll != null and coll.name = "Player": Move_and_collide(vec_to_player * speed * delta) Vec_to_player = vec_to_player.normalized() Var vec_to_player = anslation - translation Look_at(target.global_transform.origin, Vector3.UP) Var result = space_state.intersect_ray(global_transform.origin, target.global_transform.origin) Space_state = get_world().direct_space_state Onready var area = $Area/CollisionPolygon Onready var collisionshape = $Area2/CollisionShape Onready var anim_player = $AnimationPlayer Here is the script for the enemy (its really messy because I've been messing around trying to figure this out for a while now): extends KinematicBody I've looked at multiple tutorials but nothing is working.

MTASA GET PLAYER TARGET HOW TO

I cannot for the life of me figure out how to get enemies to chase the player.











Mtasa get player target