Started by
Maquinablablabla
on
Topic category: Help with MCreator software
What is "entity direction in º relative to S"?
I want to know how to put into a procedure the dirction of a mob, because of it says "entity direction in..." i thought (obviously) that was something related to direction. But I dont know how to read it, because it is in only one variable. I thought it was in two variables: "Y-axis" and "X-axis" or something like in the vanilla minecraft with commands.
Can somebody tell me how to use that variable?
You can use print to chat to print the values of this block in the chat and you will see what it does. And this has been asked quite a lot of times so just search on the forums a bit :)
I cant find any topic about that.
https://mcreator.net/forum/46622/direction-procedure-block
https://mcreator.net/forum/46661/entity-direction
Sorry Klemen, but even after printing the values to the chat, I still don't understand how to do this.
Please help.
Rotate around and you can see how the angle changes. If you don't know how angles and degrees work, check these pages:
Ok thanks
How would i move the player / a entity in the direction of the rotation of the entity or player?
Could you give me a example of a procedure / script that would do this?
I am a game dev and i normally debug stuff for hours but i think i will ask someone elses aproach to this for once.
Also i dont understand how i could convert a directional number / value into X Y Z movment x a value in this context..
Someone please get back to me..
Oh also.. how could i use this to detect vision of a entity / a player looking at a entity / vision direction..
Arrow entity ray tracing?
Someone please get back to me..
One can not control direction of an arrow yet.
You could use the sine/cosine functions to teleport an entity according to their facing direction. I can't test it rn, but an example could be:
Teleport entity at x + (5 * sin(angle)), y, z + (5 * cos(angle))
You might have to convert the angle to radians (°→rad), swap sine and cosine or change their signs. 5 would be how far the entity is teleported, and can be any number.
Yes.
Sin, Cos and Tan could fix this problem "but"
i find that Mcreator's
sin. cos and tan math functions are glitchy and unacurate to the real value.
:O
Sin, Cos and Tan values are not glitchy. They accept radiants for input as any math functions in all common programming languages do. Make sure to acknowledge that units are radians and not degrees when working with them.
Ah yes, ok thanks..