if it is me i would do this btw im a messy coder that types with only two index fingers and a good sense of where buttons are
since it is confirm u cannot manipulate group and mask ob an collision object we will set our own group and mask variables
so first u set the group to blocks and the mask to blocks
then in ur script
something like this in the init function
self.group = falling_objects
self.intact= false --intact to the tower
in the message function be like
if message id == hash("intact") then
self.intact = true
end
then in the input function be like
if action_id == hash("left") then
if self.intact == true then
self.group = baseline
--here do the move left command using some critical thinking and astrounaut tutorial script
end
end
okay
so in another script just for the collision also connected to the game object
THIS IS EXTRACTED FROM THE PHYSICS MANUAL IN THE DEFOLD WEB
function init(self)
– correction vector
self.correction = vmath.vector3()
end
function update(self, dt)
-- reset correction
self.correction = vmath.vector3()
end
function on_message(self, message_id, message, sender)
-- Handle collision
if message_id == hash("contact_point_response") then
msg.post("scipt that is up there just now","intact")
-- Get the info needed to move out of collision. We might
-- get several contact points back and have to calculate
-- how to move out of all of them by accumulating a
-- correction vector for this frame:
if message.distance > 0 then
-- First, project the accumulated correction onto
-- the penetration vector
local proj = vmath.project(self.correction, message.normal * message.distance)
if proj < 1 then
-- Only care for projections that does not overshoot.
local comp = (message.distance - message.distance * proj) * message.normal
-- Apply compensation
go.set_position(go.get_position() + comp)
-- Accumulate correction done
self.correction = self.correction + comp
end
end
end
end
so this will send a message to the main script telling it to be intact with the main body to react to the left and right keyboard input, since the falling objects is one by one, they will not colide mid air while falling, if u are going to have different falling platforms(eg speedy ones, slow ones) you can just use stuff like
if self.group == baseline then -- this is a self made up variable in script not the real mask and group
react to this crap
so they dont react to each other nor.
useful information
there is a random number generator on assets portal really useful
groupt and mask is just a built in if group == a then react u can make ur own