Problems:
1) I don't know how to apply textures to the models so I can't make it look blue and orange
2) When you place the blue portal at first, then you shoot down the orange, then you try shooting the blue again to relocate AND the old blue disapears, but the new blue doesn't show up, and then the new blue doesn't apear, and if you try shooting again it wont do anything.
Code
Problem #2:
function PortalProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
if(isobject(%obj.client.portalA) && isObject(%obj.client.portalB)){
if(%obj.client.lastportal $= "b") {
%obj.client.portalA.delete();
echo("deleting portal a"); }
else if(%obj.client.lastportal $= "a") {
%obj.client.portalB.delete();
echo("deleting portal b"); }
}
if(isObject(%obj.client.portalA) && !isObject(%obj.client.portalB)){
%pos2 = VectorAdd(%pos, "0 0" SPC 0.2);
%obj.client.portalB = new StaticShape()
{
position = %pos2;
datablock = PortalB;
scale = "2 2 2";
};
%obj.client.portalB.otherportal = %obj.client.portalA;
%obj.client.portalA.otherportal = %obj.client.portalB;
%obj.client.lastportal = "b";
echo("making portal b");
}
else
if(!isObject(%obj.client.portalA) && !isObject(%obj.client.portalB)){
%pos2 = VectorAdd(%pos, "0 0" SPC 0.2);
%obj.client.portalA = new StaticShape()
{
position = %pos2;
datablock = PortalA;
scale = "2 2 2";
};
%obj.client.lastportal = "a";
echo("making portal a");
}
}