#Head not looking at player
1 messages · Page 1 of 1 (latest)
Have you labeled the head in its own group in blockbench
It's how minecraft can tell where the head is.
ROOT /
head/...
body/...
I think it's like this
Yeah that's it, if you want I can send over my code and you can compare them
Oh and you might want to change priority to 1.
Ok
Well? It working?
Hi guys that's my problem to can I have also the code thank you
no
I don't figured out yet the solution
yes
Do you have locator?
I don't know that
Locator doesn't matter
oh
It's just animation that it, locator just add particle
I use this :
"animations": {
"look_at_target": "animation.common.look_at_target"
},
Wait
The animation is not activated that why
..
script ? :
scripts": {
"pre_animation": [
"v.rotation_to_camera_0 = -Math.atan2(-q.distance_from_camera * Math.sin(q.rotation_to_camera(0)) - 1, q.distance_from_camera * Math.cos(q.rotation_to_camera(0)));",
"v.look_at_entity = Math.abs(Math.abs(q.rotation_to_camera(1) - q.camera_rotation(1)) - 180) < (20 / q.distance_from_camera) && Math.abs(v.rotation_to_camera_0 + q.camera_rotation(0)) < (60 / q.distance_from_camera);"
]
}
Here's the locator
Maybe you should put that inside of heads folder together with cube inside the head
{
"format_version": "1.10.0",
"minecraft:client_entity": {
"description": {
"identifier": "<entity id>",
"materials": {},
"textures": {},
"geometry": {},
"scripts": {
"initialize": [],
"pre_animation": [],
"animate": [
"root"
]
},
"animations": {
"root": "controller.animation.player.root"
},
"render_controllers": [
],
"enable_attachables": true
}
}
}```
That doesn't affect animation
@midnight saffron
That's pre animation you didn't activate the animation at all
This is just a sample template
with this it doesn't work :
"animate": [
"look_at_target"
]
Send the whole RP entity file
That's shouldn't happen
{ "format_version": "1.20.50", "minecraft:client_entity": { "description": { "identifier": "zelda:activated_ground_guardian", "materials": { "default": "entity_emissive_alpha" }, "textures": { "frame_0": "textures/entity/gnd_guardian/gnd_gua1", "frame_1": "textures/entity/gnd_guardian/gnd_gua2", "frame_2": "textures/entity/gnd_guardian/gnd_gua3" }, "geometry": { "default": "geometry.activated_ground_guardian" }, "render_controllers": [ "controller.render.activated_ground_guardian" ], "animations": { "look_at_target": "animation.common.look_at_target" }, "scripts": { "pre_animation": [ "v.rotation_to_camera_0 = -Math.atan2(-q.distance_from_camera * Math.sin(q.rotation_to_camera(0)) - 1, q.distance_from_camera * Math.cos(q.rotation_to_camera(0)));", "v.look_at_entity = Math.abs(Math.abs(q.rotation_to_camera(1) - q.camera_rotation(1)) - 180) < (20 / q.distance_from_camera) && Math.abs(v.rotation_to_camera_0 + q.camera_rotation(0)) < (60 / q.distance_from_camera);" ], "animate": [ "look_at_target" ] } } } }
Wym by it doesn't work?
The entity head doesn't move?
no
Try using tp then make the entity face you if the head loves them animation works and it's BP problem
with TP the body moves
BP :
{ "format_version": "1.20.50", "minecraft:entity": { "description": { "identifier": "zelda:activated_ground_guardian", "is_summonable": true }, "components": { "minecraft:collision_box": { "height": 3, "width": 2.95 }, "minecraft:push_through": { "value": 2.9 }, "minecraft:pushable": { "is_pushable": false, "is_pushable_by_piston": false }, "minecraft:physics": { "has_collision": true, "has_gravity": true }, "minecraft:health": { "max": 500 }, "minecraft:attack": { "damage": 0 }, "minecraft:lookat": { "search_radius": 15, "set_target": true }, "minecraft:behavior.look_at_player": { "look_distance": 15, "angle_of_view_vertical": 0, "angle_of_view_horizontal": 360, "probability": 1, "priority": 1, "target_distance": 15, "look_time": [ 900000000, 900000000 ] }, "minecraft:is_stackable": { "value": true }, "minecraft:knockback_resistance": { "max": 9999, "value": 9999 } } } }
{
"format_version" : "1.8.0",
"animations" : {
"animation.common.look_at_target" : {
"loop" : true,
"bones" : {
"head" : {
"relative_to" : {
"rotation" : "entity"
},
"rotation" : [ "query.target_x_rotation - this", "query.target_y_rotation - this", 0.0 ]
}
}
}
}
}
This is just animation
So it's impossible it doesn't work
How about the head
Is this in RP inside entity ?
Please format your code as code-blocks! This makes the text monospaced, and has support for syntax highlighting.
JSON
```json
{
"example": 123
}
```
JavaScript
```js
console.log("Hello World");
```
The character used here is the backtick. This symbol is usually at the top left of your keyboard, occupying the tilde key (~). On mobile, it will be on the second or third page of symbols.
Animation controller is different from animations
Ok
I have this {
"format_version": "1.20.50",
"animations": {
"animation.common.look_at_target": {
"loop": true,
"bones": {
"head": {
"relative_to": {
"rotation": "entity"
},
"rotation": [
"query.target_x_rotation - this",
"query.target_y_rotation - this",
0.0
]
}
}
}
}
}
The name of the bones is correct based on this
There's a built-in in mc why create another one?
If it's under animation it's nothing to change for it blockbench is responsible for that am I right ?
I don't know
Also the way he constract?
Huh?
It doesn't matter where you place the bone as long as the bone named head it will animate it no matter what
Do I need a animation controller ?
I mean his code under entity folder , is it right in constract?
No
{
"format_version": "1.20.50",
"minecraft:client_entity": {
"description": {
"identifier": "zelda:activated_ground_guardian",
"materials": {
"default": "entity_emissive_alpha"
},
"textures": {
"frame_0": "textures/entity/gnd_guardian/gnd_gua1",
"frame_1": "textures/entity/gnd_guardian/gnd_gua2",
"frame_2": "textures/entity/gnd_guardian/gnd_gua3"
},
"geometry": {
"default": "geometry.activated_ground_guardian"
},
"render_controllers": [
"controller.render.activated_ground_guardian"
],
"animations": {
"look_at_target": "animation.common.look_at_target"
},
"scripts": {
"pre_animation": [
"v.rotation_to_camera_0 = -Math.atan2(-q.distance_from_camera * Math.sin(q.rotation_to_camera(0)) - 1, q.distance_from_camera * Math.cos(q.rotation_to_camera(0)));",
"v.look_at_entity = Math.abs(Math.abs(q.rotation_to_camera(1) - q.camera_rotation(1)) - 180) < (20 / q.distance_from_camera) && Math.abs(v.rotation_to_camera_0 + q.camera_rotation(0)) < (60 / q.distance_from_camera);"
],
"animate": [
"look_at_target" <- acts like animation controller
]
}
}
}
}```
Guys try reading beginners guide
Or watch cyberaxe videos
ok
Is there a separate animation controller for look at target?
Maybe the code after script it should be animate then look at target
I don’t understand what you mean
But I see it, your code is right after pre animation , there's your animate then look at target
Sorry for my English
Are you French?
No I'm Filipino
Ok
Also the leash how to put exactly at the neck of my entity is my problem too
I think it will do the same for me my entity is not aligned
Coding is too hard
But I’ve seen people resolve it somewhere there is “default vertical angle ”
How , and what folder? Is it at the BP folder?
It's look like big boss
Try your head folder move inside the body folder
Then try in game if it's work
I can’t now
Ok
This is the same thing
I’ve tested to put head in body folder and it did not work
I will test this afternoon the locator
Nah that don't matter at all tbh
This one work I'm doing it right now and it's working