#how to place a model infront of a player when a key on the keyboard is pressed?

1 messages · Page 1 of 1 (latest)

stray shore
#

i tried chatgpt and tried searching for a tutorial but guess what.
no tutorial
chatgpt only gave me a script that worked only for PARTS, not models
(the model that will be spawned will be in replicated storage though)

warped compass
#

so it's same as for parts

#

but instead of just part cframe

#

you need to set primary part for model

#

and use setprimarypartcframe

#

like this

#

chargec it's a model

#

and in () it's where you want to put it

stable sapphire
#

that only works if the model is welded

#

if the model is fully anchored and not welded then use PivotTo

warped compass
#

never used pivotTo

stable sapphire
#

the latter works if all the parts in the model are unanchored and welded to the primary part except the primary part

warped compass
ivory kite
# warped compass and use setprimarypartcframe

Super quick bit of info from the docs:

This function has been superseded by PVInstance:PivotTo() which acts as a more performant replacement and does not change your code's behavior. Use PVInstance:PivotTo() for new work and migrate your existing Model:SetPrimaryPartCFrame() calls when convenient.

stable sapphire
#

SetPrimaryPartCFrame is deprecated yeah

#

i cant find the documentation for it

warped compass
#

alr but tbh never used PivotTo even when i was moving the whole model

#

idk how it works for me then

stable sapphire
#

oh what

warped compass
#

just saying from my own experience

ivory kite
stable sapphire
#

it means that it should not be used and is only kept for backwards compatibility

subtle juniperBOT
#

studio** You are now Level 32! **studio

stable sapphire
warped compass
#

bruh why are they making something new that has the same meaning

ivory kite
#

They both work the same way, but one is not deprecated

warped compass
#

and it's not only this one function

stable sapphire
#

the function called SetPrimaryPartCFrame moves the entire model and the function called MoveTo sets the primary part's cframe

stable sapphire
#

which is better

ivory kite
warped compass
ivory kite
warped compass
stable sapphire
#

yeah thats what i said

ivory kite