There are a range of criminal offences relating to sexual activity with a child under the age of 16. These are contained in the Sexual Offences (Scotland) Act 2009 ("the 2009 Act"). The offences contained within this legislation are based on a Scottish Law Commission report into sexual offences with the offences acknowledging and informed by the generally accepted understanding that a child's capacity to consent to sexual activity differs depending on their specific age.
Under the 2009 Act, children under the age of 13 are deemed to have no capacity to consent to sexual activity. Under section 18 of the 2009 Act, it is an offence of rape of a young child where an adult undertakes sexual activity with a child under the age of 13.
Under the 2009 Act, children aged between 13 and 15 are deemed to have only limited capacity to consent to sexual activity. So, for example, where an adult has non-consensual sexual intercourse with a 13-15 year old child, this can be prosecuted as rape under section 1 of the 2009 Act. Where it cannot be proven that the child did not consent, this is still an offence which can be prosecuted using the offence of 'sexual intercourse with an older child' under section 28 of the 2009 Act.
As can be seen, the 2009 Act provides that it is always a criminal offence for an adult to knowingly engage in sexual activity with a child under the age of 16.