#how to make part rotate towards player head always?
1 messages · Page 1 of 1 (latest)
"head" -> "Head" in line 7
use a billboardgui
this won’t achieve the effect I want
sure it will, billboardgui has property to always face the camera, and you want sprites right? well a sprite is just an image, so you can use imagelabel
if you insist on doing this still though, it should be .lookAt the camera not the character's head
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
Billboardgui keeps the size consistent even with distance away from it
use scale instead of offset
or the other way around i can never remember with the billboardgui
billboard GUI all keeps the texture always facing directly towards the player
I only want horizontal rotation
not vertical
Nice catch but does not fix
you can have the localscript create the sprite part on the client coz otherwise it is subject to this problem, and just do that
don't want both server and client trying to rotate the part at the same time
i can't view these coz bandwidth. i'm assuming you're talking about those games where a giant image of a meme chases you
its lookman from doors
** You are now Level 3! **
if you mean nextbots yes
that is the same effect
since those also dont rotate vertically
nextbot is just an npc module
its name comes from gmod nextbot
but they are unrelated
you can do this in roblox with regular humanoids since those don't pitch or roll either
depends exactly what you're after
but you are right that the rotation should stay clientsided
but i dont know how to do that
do this on a part created in a localscript instead of the part the server is controlling
also you forgot task.wait in that loop
i still dont know how to do that LOL
im new to scripting like this is the third one i've ever written
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
no, scripters are just clever and can figure out ways to do things
we make it look easy
this is technique you'd probably use, it will make the sprite face whoever the local player is.
one more thing to note, localscripts dont run in workspace so that's probably another problem you're having
if it did run, this script would crash studio
the while true do ... end without a yield (task.wait or similar) crashes studio, and the roblox player, if it runs.
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
you need to make the lookat position have the same y value as the origin
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
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!!
this was just a test to see how to get the texture to face the player for future reference so thank you for helping me get it working
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
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
worked, tysm!!
** You are now Level 4! **
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
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
what's a draft
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