#how to make part rotate towards player head always?

1 messages · Page 1 of 1 (latest)

snow crag
#

in some horror games there are sprites that always face towards the players screen and i was wondering how to replicate that!!

#

i have this code but it doesn't rotate my follower part

viral widget
#

use a billboardgui

snow crag
viral widget
viral widget
#

but if it is moving and rotating on the server then the server will override

#

so you can see how a billboardgui simply solves a bunch of problems

snow crag
#

Billboardgui keeps the size consistent even with distance away from it

viral widget
#

or the other way around i can never remember with the billboardgui

snow crag
#

billboard GUI all keeps the texture always facing directly towards the player

#

I only want horizontal rotation

#

not vertical

viral widget
#

the camera, not the player

#

but i think i see where you're going with it

snow crag
viral widget
#

don't want both server and client trying to rotate the part at the same time

snow crag
#

true

viral widget
snow crag
#

its lookman from doors

heady yokeBOT
#

studio** You are now Level 3! **studio

snow crag
#

doors has a lot of examples of this

#

with rush, eyes,

snow crag
#

that is the same effect

#

since those also dont rotate vertically

viral widget
#

nextbot is just an npc module

#

its name comes from gmod nextbot

#

but they are unrelated

viral widget
#

depends exactly what you're after

snow crag
#

but you are right that the rotation should stay clientsided

#

but i dont know how to do that

viral widget
#

also you forgot task.wait in that loop

snow crag
#

im new to scripting like this is the third one i've ever written

snow crag
#

it shouldn't be this hard to just make something face the player though

#

but i've learned things are aways more complicated than they look

#

i thought a 2d sprite facing the player was commonplace

viral widget
#

we make it look easy

viral widget
viral widget
# snow crag

one more thing to note, localscripts dont run in workspace so that's probably another problem you're having

viral widget
#

the while true do ... end without a yield (task.wait or similar) crashes studio, and the roblox player, if it runs.

snow crag
#

you wont believe it

#

i moved it into startercharacterscripts and it started working

#

although it still factors in vertical rotation so i need to figure out how to stop that

viral widget
#

lookat(origin, vector3.new(target.x, origin.y, target.z))

#

there's obviously other ways but this is usually the most convenient way to do it

snow crag
#

yea i dont know how to put what you just gave me into the script

#

like do i put that inside of it under it or

#

oh this works

#

thanks so much!!

snow crag
#

UNSOLVED

#

ok @viral widget there's been another problem that keeps popping up

#

every time i publish this script to roblox this error occurs

#

i have to weirdly retype the variable and it starts working again

#

but once i publish it breaks again

exotic crescent
#

Do wait for child evil follower

#

:WaitForChild(“Evil_Follower,15)

#

This will wait 15 seconds and if it doesn’t exist in that time it won’t work

snow crag
#

worked, tysm!!

heady yokeBOT
#

studio** You are now Level 4! **studio

snow crag
#

nope

#

doesn't work on mobile

#

or on pc

#

just doesnt work in game

#

only in studio

#

ehh i'll figure this out later

#

its most likely because evil_follower is in the workspace

exotic crescent
#

Make sure your publishing and confirming your drafts

#

Make sure the script is actually getting published

#

Also if it’s not anchored in workspace it won’t exist, use a script to place it from server storage

#

The reason it would only work in studio is because it loads your character faster so the look at keeps it from falling through the void destroying it

snow crag
#

the evilfollower IS anchored and does appear in game runs

#

but it does not rotate

snow crag
#

wait it works now/?!?

#

i think??

#

dont think i even changed anything

#

oh its random

#

it seems like 50/50 chance

#

im kinda looking to make it 100/0 chance

#

i removed the first part and now it only waits for the child Evil_Follower

#

this seems to have fixed it