Started by
Valikk
on
Topic category: Help with MCreator software
So, I'm making a horror mod, and I have an entity that spawns at night. What I want to do is: when the entity spawns, it forces the player to look at it for a few seconds, and only then lets the player move their camera away. That seems simple enough, but I CAN'T FIGURE OUT HOW TO MAKE THE PLAYER LOOK AT THE ENTITY. I've searched everywhere, but I haven't found any tutorials that explain how to do this. I'm still a beginner, so visual help like images or screenshots of the procedures or node setups would be really helpful.
You need to constantly set the players look direction to the angle between the players x y z and the entity's x y z. You have to calculate the angle between the two points and set the look direction to that angle, between the x and z. And set the pitch to the angle between the y.
You use some type of variable to check whether the players camera should be locked in place. Then run the stare procedure on player tick update. Use on the entity spawns, then use entity iterator to check for any entity in a 10 block area or so, if entity is type player, set logic variable to true and also set a number variable to a countdown number (a few seconds = 5 seconds, 5*20=100 ticks) set it to 100.
On player tick update, if logic variable is true, do staring procedure above and -1 from the countdown number variable. When countdown number variable = 0, set logic variable to false.
can you send a screenshot of the procedure or maybe some youtube tutorial?
nvm i got it, it works, tysm