#How tween model with position?

1 messages · Page 1 of 1 (latest)

rigid jolt
#

I'm tryin to make a projectile using tween service but the only problem is that the instance is a model. And i want to make it to be looking at HumanoidRootPart last position.

hollow igloo
#

tween the cframe of the primary part

rigid jolt
#

how im going to make it look so?

#

i want to make it to look at the HumanoidRootPart last pos

hollow igloo
#

cframe.lookat

rigid jolt
#

oke

#

like this?

hollow igloo
#

google is your friend

rigid jolt
#

bruh

rigid jolt
#

wth do u mean with google is ur friend?????

#

i want to know something that i didnt find on google

#

bro this world is cooked

woven pebble
#

you good now?

#

also my guy. naming a variable cframe doesn't turn it into a CFrame.

wintry vergeBOT
#

studio** You are now Level 1! **studio

woven pebble
#

your logic is completely fucked

#

you didn't even need to make cframe a variable in the first place. since it did nothing at all. cframe.lookAt makes no sense because your variable cframe is a Vector3 not a CFrame

#

there's also no need to tween the orientation of the projectile, unless that's what you intended. you would simply set the CFrame of the primarypart to look at the HumanoidRootPart

rigid jolt
#

now it looks like that

#

but it still doesnt make sense

#

like getposition.CFrame

rigid jolt
#

not the orientation

#

and yes i want to make the model to look at the rootpart

#

why nobody answers my questions

woven pebble
#

trying to change the orientation of a model like this requires getting the current pivot

#

you're missing that step

#

Model:GetPivot() returns a CFrame

rigid jolt
#

hmm

#

so i make a variable to it?

woven pebble
#

noooo

#

you're lacking basic programming knowledge rn

rigid jolt
#

im not from america im strugglin to understand

woven pebble
#

it's okay. but you need to understand what these functions return

rigid jolt
#

im srry

#

gulp

woven pebble
#

you wrote that line wrong.

rigid jolt
#

so how i make it

woven pebble
#

Model:GetPivot() returns a CFrame

#

specifically the CFrame of the model

rigid jolt
woven pebble
#

:GetPivot() does not have any parameters

rigid jolt
#

oke

#

so just

#

ProjectileClone:GetPivot()?

woven pebble
#
local oldPivot = ProjectileClone:GetPivot()
local newPivot = CFrame.lookAt(oldPivot.Position, ``Vector3``)
ProjectileClone:PivotTo(newPivot)

Model:GetPivot() returns a CFrame
CFrame.lookAt(Position0,Position1) : Position0 and Position1 are Vector3. The constructor returns a CFrame
Model:PivotTo(CFrame) returns a CFrame

rigid jolt
#

makes sense

#

i think it works but the tween gets the orientation too

#

how i just get the position?

#

i will try to make it to be like the launcher projectile

#

looks easy

woven pebble
#

the tween should come after the orientation change

wintry vergeBOT
#

studio** You are now Level 2! **studio

woven pebble
#

and the goal should just be {CFrame = ProjectileClone:PivotTo(Whereever you want the projectile to go)}

rigid jolt
#

thanks

#

the output said that is unable to cast a Vector3 to CF

#

but if i put the cframe it isnt going to get the orientation too?

#

heeelp

#

ProjectileClone:PivotTo(NewPivot)
local Tween = TweenService:Create(PrimaryProjectile, TweenInfo.new(3, Enum.EasingStyle.Linear), {CFrame = ProjectileClone:PivotTo(PickedPlayer.Character.HumanoidRootPart.Position)})
Tween:Play()

rigid jolt
#

@woven pebble respond me bruh

#

u r the angel

#

that is goin to save me

woven pebble
woven pebble
#

Position is a Vector3

#

not a CFrame

rigid jolt
#

so where i put it?

woven pebble
#

did you read the message?

rigid jolt
#

yeah

woven pebble
#

I gave you each constructor with the required information for it to work

#

It literally says Model:PivotTo(CFrame)

rigid jolt
#

are u saying that i need to make a new variable to make it tween?

woven pebble
#

I never said anything about a new variable

#

I'm saying you're doing it wrong

rigid jolt
#

hmmm

woven pebble
rigid jolt
#

let me read it a couple of times

woven pebble
#

look where you put in the "CFrame"

#

it's not a CFrame

#

it's a Position

#

which is a Vector3

rigid jolt
woven pebble
#

exactly

#

you can not put in a Vector3 for a CFrame

#

you're using the constructor wrong

rigid jolt
#

so how i make it

woven pebble
#

by using a CFrame

rigid jolt
#

ok i will try

#

it just teleport to meeeeeeeee

#

i made it like that

woven pebble
#

yeah

#

you set it up like that

rigid jolt
#

but it teleports to me

#

i dont want that

woven pebble
#

because you set it up to do that

#

then why did you write it to do that?

rigid jolt
#

yeah i know

rigid jolt
#

{CFrame = PickedPlayer.Character.HumanoidRootPart.CFrame} bcz if i do like that the script gets the humanoidrootpart orientation

woven pebble
#

the script gets the CFrame of the HumanoidRootPart

rigid jolt
#

yeah i just want it to get the position

#

bcz i alr know how to get the cframe

#

and mayb i will try use bodyforce but idk how use it

woven pebble
#

it will do the same thing

rigid jolt
#

what

woven pebble
#

whether you're tweening the CFrame or the Position, you're simply losing orientation

rigid jolt
#

position and orientation is not the same thing

woven pebble
#

CFrame is Position + Orientation

#

Vector3 is Position

rigid jolt
#

yeah ik

#

yeaaahhh i know what is pos

woven pebble
#

getting the Vector3 is literally going to do the same thing for you

#

your issue is that you don't seem to understand how tweens work

rigid jolt
#

yeah i dont understand

woven pebble
#

the goal is the endpoint for the part you're manipulating

rigid jolt
#

ok

woven pebble
#

you set the goal of the projectile to be your character's rootpart CFrame

#

so obviously, the part is just going to go to your character

rigid jolt
#

so it will change to zero?

#

bcz if i make a CFrame = CFrame.new(Endpos.Position) it resets the position

#

so dont use tween?

woven pebble
#

what do you mean it resets the position?

rigid jolt
#

bcz it doesnt have one so it sets to 0

woven pebble
#

huh?

rigid jolt
#

oh

#

idk wth im talkin abt

#

just help me to do bodyforce

woven pebble
#

dude

#

why don't you just go read the roblox documentation

rigid jolt
#

i will

#

but idk where starts

woven pebble
#

whereever you're struggling

rigid jolt
#

projectiles?

woven pebble
#

sure

#

but more specific

#

CFrames

#

Vector3's

#

BodyMovers

#

Tweens

#

anything you do not understand

#

and learn to read the documentation

#

it tells you what the parameters are and what the function/constructor returns

rigid jolt
#

and my brain doesnt help if i dont understand english right

woven pebble
#

yeah you're just at a disadvantage right now

wintry vergeBOT
#

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