Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[ANSWERED] How to stop Constant CFrame changes from allowing anything to push that part away?

Asked by 5 years ago
Edited 5 years ago

Hello! i looked everywhere but couldn't find this. Its kind of hard to explain. SO i constantly use CFrame movement. so i add a part then do for i do whatever stuff. and its doing the right thing, but the character causes it to move to the other direction as well. its like its mass less. but it is set to cancollide = false. so when something hits it basically it moves in other direction.

Instance.new("Part",game.Workspace).Name = "a"
g.a.Material = "Neon"
g.a.BrickColor = BrickColor.new("Baby blue")
g.a.Anchored = true
g.a.CanCollide = false
g.a.CFrame = script.Parent.Parent.Character.Humanoid.Torso.CFrame
for i = 1,100,1 do
    g.a.Size = Vector3.new(3,3,i)
    g.a.CFrame = g.a.CFrame + script.Parent.Parent.Character.Head.CFrame.lookVector * 1
    wait()
end

so this all works. but when i play and do the thing which i didn't show to activate this. It does that (moves and sizes), so yeah iv notices when ever CFrame or size or both i don't know (i tested and when you move the character while doing the thing (the part gets moved to the characters position) then yeah the part moves left or right whatever), if that part gets hit that moment then it moves :/ how can i fix this!? Oh and collisions are off. Wish i could show GIF, i dunno how. :(

2 answers

Log in to vote
0
Answered by 5 years ago

Hello sir, so i believe you said that when you zoom in your character and turn the "part" that's positioned to you moves or gets pushed and keeps moving that way. i know, weird. So maybe you can create a script to keep yourself from zooming in. I wont hurt you and embarrass you by giving you how to do it, so ill just say that if you cant create a script that keeps you from doing this then just that's your own business, if not (you don't want to do this) then what you CAN do is is try to figure out what exactly does this and see if you can make a script that somehow keeps it at the same position. something like i don't know. hmm. it can be hard to explain but you can make value, number value so every time the CFrame changes (to keep part to size in both directions as you said) the value gets bigger, and that helps this script you can make:

while variable == true do
part.CFrame = (number or character position or value or character position - that number value)-
- end

Anyways i hope this helps, its a little hard to explain but i did my best for now. ko man do your thing ;D

0
OK thanks i guess, but it there another way? easier or is that it that's all? maybe something i must select to keep it from moving, actually i would still be happy if si knew WHY it can get pushed when part is anchored and constantly sizes and CFrame changes. If not then thanks Ascriptingaccounts and this is answered, ill wait another day until i change this to answered. CommanderCaubunsia 126 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

OMG i finaly under stand WHY IT DOES HAT YESSSS :). IT CONSTANTLY MOVES IN THE LOOK VECTOR SO WHEN YOU TURN BODY (which can only be done if you zoom in since jumppower and walkspeed are currently 0) IT GOES IN THAT LOOKVECTOR BUT DOES NOT CHANGE ITS ORIENTATION. so i can fix it by ALSO telling it to constantly make the orientation same as persons hed orientation :) i actualy dont want you to be able to move so ill just fix that but hey. i found out WHY it does that. im sooo happy now :)

0
Answered CommanderCaubunsia 126 — 5y

Answer this question