I made a script make a tree fall over with tweening, but it is not so working. Is there a way to tween a tree so it falls to the ground the oposite side the tool that you are holding? Here is the script i made:
local goal = {CFrame = script.Parent.CFrame * (CFrame.new(1,1,1) * CFrame.Angles(math.rad(75),0,0))}
local tweenlog = Tween:Create(tree.Tree,tweenInfo,goal)
For some reason, your first video with the problem freezes at 1 second, so forgive me if I don’t understand something.
If I understand correctly, you want the tree to fall exactly in the opposite direction from the place where you cut it.
I’m assuming script.Parent is the tree itself.
To make it fall in the opposite direction, first you could make the tree look at your character, and then make it fall:
local tree = tree.Tree
local rootPos=CHARACTERHUMANOIDROOTPART.Position*Vector3.new(1,0,1)
rootPos += tree.Position*Vector3.new(0,1,0)
tree.CFrame = CFrame.new(tree.Position,rootPos) -- makes tree look at your character
local goal = {CFrame = tree.CFrame * (CFrame.new(1,1,1) * CFrame.Angles(math.rad(75),0,0))}
local tweenlog = Tween:Create(tree,tweenInfo,goal)
But there’s a solution you can use. You can make a Part and make its size the same as the tree size. And position it to the location you want the tree to fall over on. And make it invisible and uncollidable. Then use this script
local FallPart = --Locate the Part here
local goal = {}
goal.CFrame = FallPart.CFrame
local tweenlog = Tween:Create(tree.Tree,tweenInfo,goal)
What do you exactly mean by ‘state’? Like position?
I’ll assume that you mean position
Yes, there is. Just create a variable, and store the old position of the tree inside it. Like this
local oldPos = Vector3.new(--Write the old position of the tree before it falls over)
And when it falls down, you can make it go back to its original state(Position) by saying:
task.wait(--Put the number of seconds that the tree will take to go back to its original state)
Tree.Position = oldPos
Tree.Anchored = true -- So it doesn't fall again when it gets back to its normal position