Holding the Portal Cube

Hey there!
So I am trying to recreate a Test Chamber from the Portal games, and I am attempting to code the cube to be able to be held, and then dropped. To be more specific, when the player is close enough (When the white cylinder touches the cube), the cube should be able to be picked up (by that I mean the cube be moved right in front of the portal device). Can I get some tips on this please? Here is my code so far:

And here is a link to the CoSpace. (Note that it is the SECOND scene that I am working in, the other two are different students’ work)


1 Like

You have a mix of string and numeric values stored in “Cube_Held?” variable. I updated all assignments and check with numeric.
Also, the “When collides with” block could be taken outside the forever loop and “if statements” could be replaced by executing the code when the variable is set to corresponding value.

Here is the updated CoSpace, feel free to remix it:

Hope that helps!